chore: 隐藏 target 并调整表述,缩减日志长度

This commit is contained in:
amtoaer
2025-01-25 00:11:22 +08:00
parent 979294bb94
commit 2a98359085
10 changed files with 128 additions and 177 deletions

View File

@@ -9,9 +9,11 @@ use tracing_subscriber::util::SubscriberInitExt;
pub fn init_logger(log_level: &str) {
tracing_subscriber::fmt::Subscriber::builder()
.compact()
.with_env_filter(tracing_subscriber::EnvFilter::builder().parse_lossy(log_level))
.with_target(false)
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::new(
"%Y-%m-%d %H:%M:%S%.3f".to_owned(),
"%b %d %H:%M:%S".to_owned(),
))
.finish()
.try_init()