Skip to content

Commit 2aaf703

Browse files
committed
logger: without time, target, and anything other than span and content
1 parent 67b3fb0 commit 2aaf703

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/logger.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
use tracing_subscriber::{EnvFilter, fmt, prelude::*, registry};
22

33
pub fn init() {
4-
let fmt_layer = fmt::layer();
4+
// let fmt_layer = fmt::layer();
5+
let fmt_layer = fmt::layer()
6+
.with_line_number(false)
7+
.with_level(false)
8+
.without_time()
9+
.with_file(false)
10+
.with_target(false);
511
let env_layer = EnvFilter::from_default_env();
612
let error_layer = tracing_error::ErrorLayer::default();
713

8-
if let Err(err) = registry().with(fmt_layer).with(env_layer).with(error_layer).try_init() {
14+
if let Err(err) = registry().with(env_layer).with(error_layer).with(fmt_layer).try_init() {
915
eprintln!("Logger already init: {err}");
1016
};
1117

0 commit comments

Comments
 (0)