From afc58a79205b89310076fa65a81218e072dea25f Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 6 Dec 2025 13:00:33 +0100 Subject: [PATCH] Redirect logging to file to avoid TUI interference - Logs now written to /tmp/cm-player.log - Clean TUI display without INFO messages - Logs still available for debugging --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 62f77fe..fe1aa0d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,8 +18,18 @@ use tracing_subscriber; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - tracing_subscriber::fmt::init(); + // Initialize logging to file to avoid interfering with TUI + let log_file = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open("/tmp/cm-player.log") + .ok(); + + if let Some(file) = log_file { + tracing_subscriber::fmt() + .with_writer(std::sync::Mutex::new(file)) + .init(); + } // Get config and cache paths let config_path = config::get_config_path()?;