Skip to content

fix: apply quickUtils.logLevel, which nothing was reading - #22

Merged
kkdev92 merged 2 commits into
mainfrom
fix/apply-log-level
Aug 13, 2026
Merged

fix: apply quickUtils.logLevel, which nothing was reading#22
kkdev92 merged 2 commits into
mainfrom
fix/apply-log-level

Conversation

@kkdev92

@kkdev92 kkdev92 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Found while checking the README against the code: quickUtils.logLevel is declared in contributes.configuration, described in package.nls.json and package.nls.ja.json, documented in the README, and offered in the settings editor — and nothing reads it. grep over src/ 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.logger in src/core/services.ts, not at each call site. That is the single seam every feature's logger comes through — DiagnosticsContext, HashContext and the rest extend Services, so the context.logger in features/ resolves to it too. The five services that inject Log explicitly (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 Level is what turns debug back 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, withFields keeping the floor and its fields, and the error argument passing through
  • test/integration/testHost.test.ts — the wiring, driven through the real plan on fakes: HISTORY_CLEAR logs History cleared at info by default, and does not once logLevel is warn
  • The integration test was checked against the fault: bypassing the filter makes it fail (exit 1), restoring it makes it pass. A test that passes either way would prove nothing here, since the bug was the wiring rather than the logic
  • typecheck, lint --max-warnings 0, check:l10n, test:coverage and test:eh all exit 0 — the Extension Host lane on VS Code 1.133.0, 13 cases

🤖 Generated with Claude Code

kkdev92 and others added 2 commits August 13, 2026 13:43
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>
@kkdev92
kkdev92 merged commit 8b8d5ab into main Aug 13, 2026
8 checks passed
@kkdev92
kkdev92 deleted the fix/apply-log-level branch August 13, 2026 04:46
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