From dfc61e84084700a4744ddf021f29a7de7a5aa892 Mon Sep 17 00:00:00 2001 From: senke Date: Thu, 30 Apr 2026 15:23:43 +0200 Subject: [PATCH] refactor(stream): route audio/realtime effect-processing error through tracing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The realtime effects loop in src/audio/realtime.rs was using `eprintln!` to surface effect processing errors. That bypasses the tracing subscriber and so the error never reaches the OTel collector or the structured-log pipeline — invisible to operators in prod. Switched to `tracing::error!` with the error captured as a structured field, matching the rest of the stream server. Why this was the only console-style call to fix: The earlier audit reported 23 `console.log` instances across the codebase, but most were in JSDoc/Markdown blocks or commented-out lines. The actual production-code count, after stripping comments, was zero on the frontend, zero in the backend API server (the `fmt.Print*` calls live in CLI tools under cmd/ and are legitimate), and one in the stream server (this fix). The rest of the Rust println! calls are in load-test binaries and #[cfg(test)] blocks. Co-Authored-By: Claude Opus 4.7 (1M context) --- veza-stream-server/src/audio/realtime.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/veza-stream-server/src/audio/realtime.rs b/veza-stream-server/src/audio/realtime.rs index 21075b5bc..58e7879a5 100644 --- a/veza-stream-server/src/audio/realtime.rs +++ b/veza-stream-server/src/audio/realtime.rs @@ -8,6 +8,7 @@ use parking_lot::{Mutex, RwLock}; use std::collections::VecDeque; use std::sync::Arc; use std::time::{Duration, Instant}; +use tracing::error; /// Buffer circulaire thread-safe pour audio temps réel #[derive(Debug)] @@ -319,7 +320,7 @@ impl RealtimeAudioProcessor { config.sample_rate, config.channels, ) { - eprintln!("Effect processing error: {:?}", e); + error!(error = ?e, "Effect processing error"); } }