QVAC-20580 feat[api]: add subscribeServerLogs to capture all server logs#2558
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
review |
QVAC E2E —
|
QVAC E2E —
|
QVAC E2E —
|
QVAC E2E —
|
QVAC E2E —
|
… logs Signed-off-by: Arun Mani J <j.arunmani@proton.me>
|
review |
🎯 What problem does this PR solve?
loggingStream({ id })—SDK_LOG_IDfor SDK logs, eachmodelIdfor addon logs, each workspace key for RAG. There was no single mechanism to capture all server-side logs.loggerLevel,loggerConsoleOutput); the missing piece was a unified custom handler.📝 How does it solve it?
subscribeServerLogs(handler)(client/api/subscribe-logs.ts): one subscription that receives every server-side log (SDK + all models + RAG + any future scope) and returns anunsubscribe(). No per-ID subscriptions, no internal IDs required.SDK_ALL_LOG_ID("__all__"). On the server,sendLogToStreams(id, …)now also fans out to the__all__stream (server/bare/registry/logging-stream-registry.ts). Because every server logger already converges onsendLogToStreams(viacreateStreamLogger), this captures all scopes with no per-logger wiring.worker-corebuffers startup logs for__all__(mirroring existingSDK_LOG_IDbuffering), so a subscriber attaching just after spawn still receives early logs.subscribeServerLogs,ServerLogHandler, andSDK_ALL_LOG_IDfrom@qvac/sdk.🧪 How was it tested?
test/unit/logging-stream-global.test.ts: global stream receives logs across multiple source IDs, per-ID streams stay isolated, unsubscribe stops delivery, and buffered startup logs flush on subscribe. Fullbun run test:unitpasses.examples/logging-global.ts(+examples/config/logging/logging.config.json): one handler captures all server logs end to end; verified against a liveloadModel/completionrun (27 server logs captured acrosssdk:serverandllamacpp-completion).🔌 API Changes