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:
parent
43951a200d
commit
afc58a7920
14
src/main.rs
14
src/main.rs
@ -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()?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user