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
This commit is contained in:
Christoffer Martinsson 2025-12-06 13:00:33 +01:00
parent 43951a200d
commit afc58a7920

View File

@ -18,8 +18,18 @@ use tracing_subscriber;
#[tokio::main] #[tokio::main]
async fn main() -> Result<()> { async fn main() -> Result<()> {
// Initialize logging // Initialize logging to file to avoid interfering with TUI
tracing_subscriber::fmt::init(); 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 // Get config and cache paths
let config_path = config::get_config_path()?; let config_path = config::get_config_path()?;