From 94dac682b49abd1ce5d796f07560905c149241eb Mon Sep 17 00:00:00 2001 From: Koute Date: Tue, 26 Apr 2022 17:05:51 +0900 Subject: [PATCH] Turn on logger's interest cache (#11264) --- substrate/Cargo.lock | 6 ++++-- substrate/client/tracing/Cargo.toml | 2 +- substrate/client/tracing/src/logging/mod.rs | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 48fe7cc122..58cb4ed0e9 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -11404,12 +11404,14 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ + "ahash", "lazy_static", "log 0.4.16", + "lru 0.7.5", "tracing-core", ] diff --git a/substrate/client/tracing/Cargo.toml b/substrate/client/tracing/Cargo.toml index 121d55ca93..4178e26fe7 100644 --- a/substrate/client/tracing/Cargo.toml +++ b/substrate/client/tracing/Cargo.toml @@ -26,7 +26,7 @@ rustc-hash = "1.1.0" serde = "1.0.136" thiserror = "1.0.30" tracing = "0.1.29" -tracing-log = "0.1.2" +tracing-log = { version = "0.1.3", features = ["interest-cache"] } tracing-subscriber = { version = "0.2.25", features = ["parking_lot"] } sp-tracing = { version = "5.0.0", path = "../../primitives/tracing" } sp-rpc = { version = "6.0.0", path = "../../primitives/rpc" } diff --git a/substrate/client/tracing/src/logging/mod.rs b/substrate/client/tracing/src/logging/mod.rs index c325a3f73c..f5cdda4d35 100644 --- a/substrate/client/tracing/src/logging/mod.rs +++ b/substrate/client/tracing/src/logging/mod.rs @@ -155,7 +155,10 @@ where let max_level_hint = Layer::::max_level_hint(&env_filter); let max_level = to_log_level_filter(max_level_hint); - tracing_log::LogTracer::builder().with_max_level(max_level).init()?; + tracing_log::LogTracer::builder() + .with_max_level(max_level) + .with_interest_cache(tracing_log::InterestCacheConfig::default()) + .init()?; // If we're only logging `INFO` entries then we'll use a simplified logging format. let detailed_output = match max_level_hint {