Skip to content

Commit 021e171

Browse files
committed
Fix tracing subscriber init to support env log levels
1 parent 4989460 commit 021e171

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

trin-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]
1212
build = "build.rs"
1313

1414
[dependencies]
15-
tracing-subscriber = "0.3.15"
15+
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
1616

1717
[target.'cfg(windows)'.dependencies]
1818
# The crates for detecting whether the terminal supports colors are OS-specific.

trin-utils/src/log.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
use tracing_subscriber::EnvFilter;
2+
13
pub fn init_tracing_logger() {
24
tracing_subscriber::fmt()
5+
.with_env_filter(EnvFilter::from_default_env())
36
.with_ansi(detect_ansi_support())
47
.init();
58
}

0 commit comments

Comments
 (0)