fix: apply quickUtils.logLevel, which nothing was reading - #22
Merged
Conversation
The setting was declared in `contributes.configuration`, described in both package.nls files, documented in the README and offered in the settings editor — and no code read it. Setting it did nothing. clipshot and plantuml-local both wrap their logger with the same kind of filter; this extension was the one that never got it. The wrapper goes on the ambient `uses.logger` rather than at each call site, because that is the single seam every feature's logger comes through: `DiagnosticsContext` and friends extend `Services`, so `context.logger` resolves to it too. The level is read per call rather than captured. The services holding a logger are singletons built once at activation, so capturing would mean the setting only took effect after a reload, which is not how any other setting here behaves. It remains a floor and cannot raise the level: VS Code owns a LogOutputChannel's level, per channel, in the Output panel. The integration test fails without the wiring (verified by bypassing the filter and rerunning) and covers the seam; the unit test covers the comparison and the per-call read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Found while checking the README against the code:
quickUtils.logLevelis declared incontributes.configuration, described inpackage.nls.jsonandpackage.nls.ja.json, documented in the README, and offered in the settings editor — and nothing reads it.grepoversrc/finds exactly two hits, both the declaration itself.clipshot and plantuml-local each wrap their logger with the same kind of filter. This extension is the one that never got it.
Where the wrapper goes
On the ambient
uses.loggerinsrc/core/services.ts, not at each call site. That is the single seam every feature's logger comes through —DiagnosticsContext,HashContextand the rest extendServices, so thecontext.loggerinfeatures/resolves to it too. The five services that injectLogexplicitly (services are excluded from the ambient set by design) were switched to the same token.The level is read per entry rather than captured at construction. The services holding a logger are singletons built once at activation, so capturing would mean the setting only took effect after a reload — not how any other setting here behaves.
settings.read()on the unscoped snapshot is cached, so the cost is a property read.It remains a floor and cannot raise the level: VS Code owns a
LogOutputChannel's level, per channel, in the Output panel.Developer: Set Log Levelis what turnsdebugback on. The README and both nls descriptions already said this, and are now true.Verification
test/unit/logging.test.ts— the comparison at every level, the per-call re-read,withFieldskeeping the floor and its fields, and the error argument passing throughtest/integration/testHost.test.ts— the wiring, driven through the real plan on fakes:HISTORY_CLEARlogsHistory clearedat info by default, and does not oncelogLeveliswarntypecheck,lint --max-warnings 0,check:l10n,test:coverageandtest:ehall exit 0 — the Extension Host lane on VS Code 1.133.0, 13 cases🤖 Generated with Claude Code