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

feat: allow for custom logger with streamable files #12558

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

jmcdo29
Copy link
Member

@jmcdo29 jmcdo29 commented Oct 11, 2023

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?

When the StreamableFile handle has an error, it uses the built in this.logger.error() handler to log the error. This works, but can cause a lot of noise with the stack trace that gets printed.

Issue Number: #12542

What is the new behavior?

Devs are now able to do new StreamableFile().setErrorLogger((err) => this.logger.error(err.message)) to only log the message and not the stack trace, or whatever other custom logging they want to use

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build 0f35b722-bcbc-4855-9748-37f036ca76d7

  • 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.639%

Totals Coverage Status
Change from base Build 79434c05-5367-4a7a-a04c-0f91cc807577: 0.0%
Covered Lines: 6469
Relevant Lines: 6983

💛 - Coveralls

@kamilmysliwiec kamilmysliwiec merged commit e6276d5 into nestjs:master Oct 23, 2023
5 checks passed
@kamilmysliwiec
Copy link
Member

lgtm

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.

5 participants