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()?;