diff --git a/Cargo.toml b/Cargo.toml index 83115c9..a4e1ceb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ librqbit = {version = "9.0.0-beta.1", features = ["disable-upload"]} log = "0.4" regex = "1.11" tokio = { version = "1.45", features = ["full"] } -tracing-subscriber = "0.3" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } url = "2.5" urlencoding = "2.1" diff --git a/src/main.rs b/src/main.rs index 8b6f2bc..daf9f6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,14 +17,14 @@ async fn main() -> Result<()> { use tokio::time; // debug if std::env::var("RUST_LOG").is_ok() { - use tracing_subscriber::fmt::*; + use tracing_subscriber::{EnvFilter, fmt::*}; struct T; impl time::FormatTime for T { fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result { write!(w, "{}", Local::now()) } } - fmt().with_timer(T).init() + fmt().with_timer(T).with_env_filter(EnvFilter::from_default_env()).init() } // init components let time_init = Local::now();