Skip to content

Commit dc238e1

Browse files
committed
Incorporate feedback
1 parent 85b2447 commit dc238e1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/logger/src/formatter/LogFormatter.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ abstract class LogFormatter {
116116
name,
117117
location: this.getCodeLocation(error.stack),
118118
message,
119-
stack,
119+
stack:
120+
this.envVarsService?.isDevMode() && typeof stack === 'string'
121+
? stack?.split('\n')
122+
: stack,
120123
cause:
121124
error.cause instanceof Error
122125
? this.formatError(error.cause)
@@ -131,13 +134,6 @@ abstract class LogFormatter {
131134
}
132135
}
133136

134-
if (
135-
this.envVarsService?.isDevMode() &&
136-
typeof formattedError.stack === 'string'
137-
) {
138-
formattedError.stack = formattedError.stack.split('\n');
139-
}
140-
141137
return formattedError;
142138
}
143139

0 commit comments

Comments
 (0)