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: ability to disable debug message in ConditionalModule #1677

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

dariusj18
Copy link
Contributor

Add an option debug defaulted to true to the registerWhen method and only create debug log when it is set to true. Also adjust the type for options.timeout to be optional.

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?

Currently a ConditionalModule is run when a javascript module is loaded but before any NestJS setup occurs. The ConditionalModule. In this case, the module will output a debug log via the default ConsoleLogger with no ability to silence the message.

Issue Number: N/A

What is the new behavior?

Add an option to the ConditionalModule's registerWhen method to disable the debug message.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The debug flag is defaulted to true so that no change will be observed, however the timeout option is being flagged as optional so previous code that would have shown a type error with an empty object will now pass.

Add an option `debug` defaulted to true to the `registerWhen` method and only create debug log when it is set to true. Also fix type for options.timeout to be optional.
@kamilmysliwiec kamilmysliwiec merged commit 8b37dfb into nestjs:master Apr 5, 2024
1 check passed
@kamilmysliwiec
Copy link
Member

LGTM

@kamilmysliwiec kamilmysliwiec added the enhancement New feature or request label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants