use env-filter feature

This commit is contained in:
yggverse 2025-09-13 00:27:52 +03:00
parent dd73040dba
commit 569c86008e
2 changed files with 3 additions and 3 deletions

View file

@ -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"

View file

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