feat(kernel-cli): filter daemon log entries below a minimum severity - #1008
Merged
Conversation
The daemon log was recording every level, and high-volume `debug` output (refcount churn and similar) dominated `daemon.log` to the point of making it hard to read while debugging anything else. The file transport now drops entries below a minimum severity, defaulting to `info`; set `$OCAP_DAEMON_LOG_LEVEL` to `debug` to record everything again. `LOG_LEVELS` mirrors @metamask/logger's ordering because `logLevels` is not part of that package's public surface, and it is declared above the file-scope logger construction so the transport factory does not hit a temporal-dead-zone reference when called during module init. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
FUDCo
marked this pull request as ready for review
August 5, 2026 01:21
sirtimid
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small, self-contained quality-of-life change to the daemon's log transport, extracted from
chip/orchestration-demo. Independent of the kernel work in #1007 — this branches offmaindirectly rather than stacking.Problem
daemon.logrecorded every level. In practicedebugoutput — refcount churn especially — dominated the file badly enough to make it hard to read while debugging anything else. On a busy daemon the signal you actually want is buried.Change
The file transport drops entries below a minimum severity, defaulting to
info. Set$OCAP_DAEMON_LOG_LEVEL=debugto record everything again.Two details worth a reviewer's eye:
LOG_LEVELSmirrors@metamask/logger's level ordering locally becauselogLevelsisn't part of that package's public surface. If it's ever exported, this should switch to importing it rather than keeping a copy in sync.LOG_LEVELSin its temporal dead zone at exactly the moment it's read.Not included
The fatal-path handler work that lives in the same file is already on
main(#966), so this PR touches only the level-filtering lines.Validation
@metamask/kernel-clibuilds, lints, and its tests pass. Changelog entry follows in a second commit once this PR has a number to link to.🤖 Generated with Claude Code
Note
Low Risk
Observability-only change to log file filtering; no auth, RPC, or persistence behavior is affected.
Overview
daemon.lognow skips entries below a minimum severity (defaultinfo) in the daemon file transport, so noisydebuglines no longer bury useful output.The threshold comes from
OCAP_DAEMON_LOG_LEVEL; set it todebugto record all levels again.makeFileTransportcompares each entry against a localLOG_LEVELSmap (mirroring@metamask/loggerordering, since levels aren’t exported). Changelog documents the behavior change.Reviewed by Cursor Bugbot for commit 66dc26d. Bugbot is set up for automated code reviews on this repo. Configure here.