Skip to content

Commit

Permalink
Merge pull request #13317 from hokaccha/fix-console-logger-is-stack
Browse files Browse the repository at this point in the history
fix(common): fix stacktrace regex
  • Loading branch information
kamilmysliwiec authored Mar 17, 2024
2 parents 1bf2dc4 + ca0e385 commit 57bae20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/common/services/console-logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export class ConsoleLogger implements LoggerService {
return false;
}

return /^(.)+\n\s+at .+:\d+:\d+$/.test(stack);
return /^(.)+\n\s+at .+:\d+:\d+/.test(stack);
}

private getColorByLogLevel(level: LogLevel) {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/test/services/logger.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ describe('Logger', () => {

it('should print one error to the console with stacktrace', () => {
const message = 'random error';
const stacktrace = 'Error: message\n at <anonymous>:1:2';
const stacktrace = new Error('err').stack;

logger.error(message, stacktrace);

Expand Down

0 comments on commit 57bae20

Please sign in to comment.