Skip to content

Commit 6cb6ff5

Browse files
aksOpsclaude
andcommitted
chore(serve): downgrade per-session publish and hub unsubscribe logs to Debug
These fire on every statusline dump (multiple/sec during active sessions) and on every tab close / SSE reconnect respectively — too chatty for normal operation at Info level. Global-quota publishes stay at Info since rate-limit buckets only shift every few minutes. Useful diagnostic signal is preserved: flip the daemon to Debug when needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 76d23c2 commit 6cb6ff5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

internal/serve/events/hub.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ func (h *Hub) removeSub(s *Sub) {
282282
delete(h.subs, s)
283283
remaining := len(h.subs)
284284
h.mu.Unlock()
285-
slog.Info("hub unsubscribe",
285+
// Debug-level: tab closes, navigations, and fetch-event-source
286+
// reconnects all produce unsubscribes. Watching these at Info is
287+
// too chatty for normal operation.
288+
slog.Debug("hub unsubscribe",
286289
"filter", s.filter, "dropped", s.dropped.Load(),
287290
"subscribers_after", remaining)
288291
}

internal/serve/ingest/quota.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ func (q *QuotaIngester) publishSession(name string) {
310310
"output_tokens": s.outputTokens,
311311
"cache_tokens": s.cacheTokens,
312312
})
313-
slog.Info("quota publish session",
313+
// Debug-level: fires on every statusline dump where any token
314+
// field changed, which during active sessions is multiple times a
315+
// second. Global-quota publishes stay at Info — they only move
316+
// when rate-limit buckets actually shift.
317+
slog.Debug("quota publish session",
314318
"session", name, "context_pct", s.contextPct,
315319
"input", s.inputTokens, "output", s.outputTokens, "cache", s.cacheTokens)
316320
q.hub.Publish(events.Event{Type: "quota_update", Session: name, Payload: body})

0 commit comments

Comments
 (0)