Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(common): fix stacktrace regex #13317

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

hokaccha
Copy link
Contributor

@hokaccha hokaccha commented Mar 13, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

const logger = new Logger();
const err = new Error("err");
logger.error(err.message, err.stack);

output:

[Nest] 54113  - 03/13/2024, 11:06:24 PM   ERROR [Error: err!
    at bootstrap (/path/to/src/main.ts:30:15)] err!

What is the new behavior?

[Nest] 54113  - 03/13/2024, 11:06:24 PM   ERROR err!
Error: err!
    at bootstrap (/path/to/src/main.ts:30:15)

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@@ -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);
Copy link
Contributor Author

@hokaccha hokaccha Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual string of stacktrace does not end with a number.

Error: err!
    at bootstrap (/path/to/src/main.ts:30:15)

@coveralls
Copy link

Pull Request Test Coverage Report for Build c4df0b41-381f-4f89-986c-a7e58165c4fa

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.16%

Totals Coverage Status
Change from base Build 14a5790e-1a63-471c-9a82-c6e1ef81c364: 0.0%
Covered Lines: 6736
Relevant Lines: 7309

💛 - Coveralls

@kamilmysliwiec kamilmysliwiec merged commit 57bae20 into nestjs:master Mar 17, 2024
3 checks passed
@kamilmysliwiec
Copy link
Member

LGTM

@hokaccha hokaccha deleted the fix-console-logger-is-stack branch March 17, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants