Summary
Structured tracing (tracing::info!, tracing::warn!, tracing::error!) is used in most modules, but claude_code.rs, main.rs, and update.rs emit diagnostic output via raw eprintln!, bypassing the tracing subscriber. Some events are double-logged. The entire update.rs (672 lines) has zero tracing calls.
Severity: S2 (Medium) | Confidence: 0.95 | Blast radius: Low
Technical Details
Double-logging (same event, two sinks):
// src/main.rs:357-358
tracing::error!("failed to write report: {e}");
eprintln!("WARNING: failed to write report: {e}"); // same event!
Verbose output bypassing tracing:
// src/claude_code.rs:174, 184, 229, 237, 238
eprintln!("[verbose] ..."); // should be tracing::debug!
Entire module invisible to structured logs:
src/update.rs — 672 lines, zero tracing:: calls, all output via eprintln!
- Lines 375, 391, 559 — error/progress output that never appears in the log file created by
diagnostics::init_tracing
Impact:
- Post-mortem debugging of update failures requires reproducing the issue (no log trail)
- Verbose provider output is invisible to the tracing subscriber and any log aggregation
- The double-logging in
main.rs produces duplicate entries in different formats
Proposed Fix
- update.rs: Replace all
eprintln! calls with appropriate tracing::info! / tracing::warn! / tracing::error! calls (~10 replacements)
- claude_code.rs: Replace verbose
eprintln!("[verbose]...") with tracing::debug! (lines 174, 184, 229, 237, 238)
- main.rs: Remove duplicate
eprintln! calls where tracing::error! is already used (line 358). Keep eprintln! only for pre-tracing-init errors (acceptable fallback)
Estimated effort: ~3 hours
Related
- Part of refactor Bundle 5: Unified Observability
🔍 Found by vibe-code-audit — automated codebase audit skill for Claude Code.
Summary
Structured tracing (
tracing::info!,tracing::warn!,tracing::error!) is used in most modules, butclaude_code.rs,main.rs, andupdate.rsemit diagnostic output via raweprintln!, bypassing the tracing subscriber. Some events are double-logged. The entireupdate.rs(672 lines) has zero tracing calls.Severity: S2 (Medium) | Confidence: 0.95 | Blast radius: Low
Technical Details
Double-logging (same event, two sinks):
Verbose output bypassing tracing:
Entire module invisible to structured logs:
src/update.rs— 672 lines, zerotracing::calls, all output viaeprintln!diagnostics::init_tracingImpact:
main.rsproduces duplicate entries in different formatsProposed Fix
eprintln!calls with appropriatetracing::info!/tracing::warn!/tracing::error!calls (~10 replacements)eprintln!("[verbose]...")withtracing::debug!(lines 174, 184, 229, 237, 238)eprintln!calls wheretracing::error!is already used (line 358). Keepeprintln!only for pre-tracing-init errors (acceptable fallback)Estimated effort: ~3 hours
Related