QVAC-20891 feat[bc]: silence SDK and native logs by default, opt in to surface them#2653
Conversation
simon-iribarren
left a comment
There was a problem hiding this comment.
Findings
Blocking: loggerLevel: "off" still emits to streams and transports
packages/sdk/schemas/logging-stream.ts now accepts "off" as a public config/logging level, and the PR body says this should silence capture entirely. The SDK wrapper gate still compares priorities directly in packages/sdk/logging/utils.ts:
return messagePriority <= currentPriority;Because @qvac/logging defines off with priority 4, every normal level still passes that comparison (error=0, debug=3, off=4). createBaseLogger() may skip console output because the wrapped QvacLogger handles off, but it still calls stream callbacks and custom transports. Consumers who set loggerLevel: "off" will still receive SDK logs through loggingStream() / transports, which contradicts the documented behavior.
Please update the SDK gate so current level "off" disables all emissions, and add coverage that verifies console, loggingStream(), and transports receive no messages at "off".
Major: raw worker stderr is not routed to loggingStream()
packages/sdk/client/rpc/node-rpc-client.ts creates workerLogger with getLogger(SDK_SERVER_NAMESPACE, { enableConsole: false }) and logs stderr chunks with workerLogger.debug(...). That logger is registered for global level/console toggles, but it is not a stream logger. Only createStreamLogger() wires onLog to sendLogToStreams().
Impact: loggerConsoleOutput: true plus loggerLevel: "debug" can surface raw worker stderr to the console after config applies, but loggingStream({ id: SDK_LOG_ID }) will not receive those raw native stderr lines. The PR description says native stderr is re-emitted under the existing sdk:server logger and that stream/transports still receive logs; the implementation does not satisfy that for this path.
Please either route this through a stream logger path, or explicitly document that raw worker stderr can only be surfaced through console output and crash diagnostics, not loggingStream().
CI Status
Checked with gh pr checks 2653 --repo tetherto/qvac: all relevant PR checks are passing, including SDK Pod Checks, Docs Website Build, SDK build, bare-sdk build, and PR validation. Publish/release jobs are skipped as expected for a PR.
API Surface & Tagging
This changes public SDK logging behavior and config semantics, including the default console behavior and the accepted loggerLevel values. The [bc] title tag is appropriate, and the PR body includes BEFORE/AFTER migration evidence plus docs updates.
Recommendation
Request changes until the "off" implementation and worker stderr streaming semantics are corrected or documented accurately.
|
@simon-iribarren thanks for the review. Blocking — raw worker stderr is not routed to loggingStream() |
Tier-based Approval Status |
QVAC E2E —
|
QVAC E2E —
|
QVAC E2E —
|
|
review |
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
…ilent by default Signed-off-by: Arun Mani J <j.arunmani@proton.me>
|
review |
🎯 What problem does this PR solve?
📝 How does it solve it?
info, sologgingStream/ transports still receive everything; a consumer's owngetLogger("my-app")is unaffected.loggerConsoleOutput: trueinqvac.config.*;loggerLevelalso accepts"off"to silence capture entirely (console, streams, and transports). The default lives in the logger factories rather than a schema default, because a missing config file is never parsed.loggingStream/ transports still receive them. The worker's raw stderr (ggml backends that write directly) is captured client-side and re-emitted at debug under thesdk:serverlogger, surfacing through console output when enabled and the crash-diagnostic stderr tail. Both honorloggerConsoleOutput/loggerLevel, so native output needs no separate switch.verbositygate (andverbosityexists for only some engines). Routing the worker stderr through the logger silences every engine uniformly with no native-addon changes, and removes the last place the SDK wrote to the console directly. The captured stderr tail still backs crash diagnostics.console/stdout/stderrwrites remain, except the logging system's own recursion-safe fallbacks.🧪 How was it tested?
test/unit/logging-defaults.test.ts: SDK loggers are console-off by default, transports still receiveinfologs,enableConsoleopts back in, andlogLevelSchemaaccepts"off".worker-startup-error.test.tspasses — crash diagnostics use the captured stderr tail.bun run build(lint + typecheck + compile) passes.💥 Breaking Changes
BEFORE:
AFTER: