From a744447bb565a20cf1a8cd4da28133d58061e6fa Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 8 Sep 2022 10:45:47 +0200 Subject: [PATCH] test: Respect RUST_LOG in integration-testing --- testing/matrix-sdk-integration-testing/Cargo.toml | 2 +- testing/matrix-sdk-integration-testing/src/tests.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/Cargo.toml b/testing/matrix-sdk-integration-testing/Cargo.toml index 5737e323a..eb1a21d6b 100644 --- a/testing/matrix-sdk-integration-testing/Cargo.toml +++ b/testing/matrix-sdk-integration-testing/Cargo.toml @@ -13,4 +13,4 @@ matrix-sdk = { path = "../../crates/matrix-sdk" } once_cell = "1.13.0" tempfile = "3.3.0" tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] } -tracing-subscriber = "0.3.15" +tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/testing/matrix-sdk-integration-testing/src/tests.rs b/testing/matrix-sdk-integration-testing/src/tests.rs index 31f4ea491..147daf857 100644 --- a/testing/matrix-sdk-integration-testing/src/tests.rs +++ b/testing/matrix-sdk-integration-testing/src/tests.rs @@ -15,7 +15,11 @@ static USERS: Lazy>> = Lazy::new(Mutex: #[ctor::ctor] fn init_logging() { - tracing_subscriber::FmtSubscriber::builder().with_test_writer().init(); + use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; + tracing_subscriber::registry() + .with(tracing_subscriber::EnvFilter::from_default_env()) + .with(tracing_subscriber::fmt::layer().with_test_writer()) + .init(); } /// read the test configuration from the environment