Skip to content

Conversation

@FUDCo
Copy link
Contributor

@FUDCo FUDCo commented Nov 27, 2025

With this change, log messages will be suppressed if they are at a lower level than whatever the current log level setting is (i.e., if the setting is 'error', a call to log.debug(...) will output nothing).

Currently the log level is set on a per-logger basis via the level option to the Logger constructor.

For backwards compatibility until we decide otherwise, if unspecified the level defaults to 'debug', i.e., always print all log messages. However, now that we can obey the level setting, we should probably consider changing the default. We probably should also consider adding an 'off' level that suppresses all log output, but for weird complicated reasons having to do with conflation of the console API with the level name strings that's tricky. (I'd argue that the default level should either be 'error' or 'off'.)

Eventually we will probably also want to read the setting from an environment variable, but that's an additional bundle of complication that deserves its own issue.

Closes #679


Note

Introduce level-filtering makeConsoleTransport and remove level from Logger options, updating types, dispatch, tests, and consumers.

  • Logger:
    • Replace consoleTransport with level-aware makeConsoleTransport(level = 'debug').
    • Change logLevels from array to keyed object; LogLevel is now keyof typeof logLevels.
    • Remove level from LoggerOptions; parseOptions defaults to makeConsoleTransport().
    • Update Logger internals: #dispatch(options, level, ...args); injectStream and method bindings pass level separately.
    • Update exports: makeConsoleTransport instead of consoleTransport.
  • Transports:
    • Implement filtering in makeConsoleTransport; keep makeStreamTransport/makeArrayTransport unchanged.
  • Tests:
    • Adjust all logger tests to new API and level-filtering behavior.
    • Update index/options/transports tests and expectations.
  • Consumers:
    • Replace usages of consoleTransport with makeConsoleTransport() in kernel tests and agents.
  • Config/Build:
    • Tweak coverage thresholds; remove obsolete Node builtins ESLint suppressions; minor shell script cleanup.

Written by Cursor Bugbot for commit b03545a. This will update automatically on new commits. Configure here.

@FUDCo FUDCo requested a review from a team as a code owner November 27, 2025 22:46
@FUDCo FUDCo force-pushed the chip/logging-levels branch from 2cb58de to f31354f Compare November 30, 2025 01:44
@FUDCo FUDCo force-pushed the chip/logging-levels branch from 7d1bb4a to 90d4d4e Compare December 1, 2025 18:01
@grypez
Copy link
Contributor

grypez commented Dec 1, 2025

Prefer relocating the 'level' option from the logger constructor to the default console transport constructor.

Copy link
Contributor

@grypez grypez left a comment

Choose a reason for hiding this comment

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

Approved

@FUDCo FUDCo merged commit c16febd into main Dec 4, 2025
26 checks passed
@FUDCo FUDCo deleted the chip/logging-levels branch December 4, 2025 18:26
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.

Logger disregards log level

3 participants