Skip to content

Commit

Permalink
fix new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored and mikearnaldi committed Jul 3, 2024
1 parent c1ec073 commit 7ebc972
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/effect/src/internal/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,33 +436,28 @@ export const prettyLogger = (options?: {
}
}

logMessage += "\n"

if (!Cause.isEmpty(cause)) {
const lines = Cause.pretty(cause).split("\n")
for (let i = 0; i < lines.length; i++) {
logMessage += " " + lines[i] + "\n"
logMessage += "\n " + lines[i]
}
}

if (messageIndex < message.length) {
for (; messageIndex < message.length; messageIndex++) {
const lines = Inspectable.stringifyCircular(message[messageIndex], 2).split("\n")
for (let i = 0; i < lines.length; i++) {
logMessage += " " + lines[i] + "\n"
logMessage += "\n " + lines[i]
}
}
}

if (HashMap.size(annotations) > 0) {
for (const [key, value] of annotations) {
logMessage += " " + color(`${key}:`, colors.bright, colors.white) + " "
logMessage += "\n " + color(`${key}:`, colors.bright, colors.white) + " "
const lines = Inspectable.stringifyCircular(value, 2).split("\n")
for (let i = 0; i < lines.length; i++) {
if (i > 0) {
logMessage += " "
}
logMessage += lines[i] + "\n"
logMessage += (i > 0 ? "\n " : "") + lines[i]
}
}
}
Expand Down

0 comments on commit 7ebc972

Please sign in to comment.