implement custom debug time formatter

This commit is contained in:
yggverse 2025-08-18 19:05:55 +03:00
parent 18db12dad3
commit 5025e178a4

View file

@ -18,10 +18,17 @@ async fn main() -> Result<()> {
use chrono::Local; use chrono::Local;
use clap::Parser; use clap::Parser;
use tokio::time; use tokio::time;
// init debug // debug
if std::env::var("RUST_LOG").is_ok() { if std::env::var("RUST_LOG").is_ok() {
tracing_subscriber::fmt::init() use tracing_subscriber::fmt::{time::FormatTime, *};
} // librqbit struct T;
impl FormatTime for T {
fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result {
write!(w, "{}", Local::now())
}
}
fmt().with_timer(T).init()
}
// init components // init components
let time_init = Local::now(); let time_init = Local::now();
let config = Config::parse(); let config = Config::parse();