Skip to content

fix: honor silent settings in level-enabled checks - #2646

Open
Shubham-Padkonde wants to merge 1 commit into
winstonjs:masterfrom
Shubham-Padkonde:fix/silent-level-enabled-checks
Open

Shubham-Padkonde wants to merge 1 commit into
winstonjs:masterfrom
Shubham-Padkonde:fix/silent-level-enabled-checks

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

isLevelEnabled() and the generated helpers such as isDebugEnabled() currently return true even when logging is suppressed by silent. Callers using these helpers to avoid preparing unused messages still do that work for a muted logger or transport.

Return false when the logger is silent and exclude silent transports when checking their levels. Active transports retain their existing thresholds, and changing silent at runtime is reflected on the next check. This changes the helpers only; it does not change message delivery or formatting.

Three new regressions cover a silent logger, a silent transport, and mixed active/silent transports. All three fail before the fix; all 68 logger tests pass afterward (one existing todo). Repository lint passes with ten existing warnings.

The broader Windows run passes 235 tests, with three todos and five file-transport failures. Those same five failures also occur with the original logger implementation; the baseline file-only run has nine failures in total. The broader suite leaves open handles, so the subsequent focused runs use Jest's --forceExit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant