From c6ee97cc74d023a891fd6029d8f4bd3f67d4fbe2 Mon Sep 17 00:00:00 2001 From: cdamian <17934949+cdamian@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:07:49 +0200 Subject: [PATCH] tests: Set default log level --- core/src/tests/utils.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/tests/utils.rs b/core/src/tests/utils.rs index 193f935..6c6f3eb 100644 --- a/core/src/tests/utils.rs +++ b/core/src/tests/utils.rs @@ -11,12 +11,16 @@ // GNU General Public License for more details. use sp_std::sync::atomic::{AtomicUsize, Ordering}; +use tracing_subscriber::filter::LevelFilter; + static GLOBAL_INIT: AtomicUsize = AtomicUsize::new(UNINITIALIZED); const UNINITIALIZED: usize = 0; const INITIALIZING: usize = 1; const INITIALIZED: usize = 2; +const LOG_LEVEL: LevelFilter = LevelFilter::DEBUG; + pub fn init_logs() { if GLOBAL_INIT .compare_exchange( @@ -28,6 +32,8 @@ pub fn init_logs() { .is_ok() { GLOBAL_INIT.store(INITIALIZED, Ordering::SeqCst); - tracing_subscriber::fmt::init(); + tracing_subscriber::fmt::fmt() + .with_max_level(LOG_LEVEL) + .init(); } }