test(sdk): Enable logging for tests

This commit is contained in:
Jonas Platte
2022-09-08 10:46:27 +02:00
committed by Jonas Platte
parent a744447bb5
commit d810fa6883
3 changed files with 12 additions and 0 deletions

1
Cargo.lock generated
View File

@@ -2192,6 +2192,7 @@ dependencies = [
"async-trait",
"backoff",
"bytes",
"ctor",
"dashmap",
"dirs",
"event-listener",

View File

@@ -150,5 +150,6 @@ getrandom = { version = "0.2.6", default-features = false, features = ["js"] }
wasm-bindgen-test = "0.3.30"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
ctor = "0.1.23"
tokio = { version = "1.17.0", default-features = false, features = ["rt-multi-thread", "macros"] }
wiremock = "0.5.13"

View File

@@ -55,3 +55,13 @@ pub use media::Media;
#[cfg(test)]
mod test_utils;
#[cfg(all(test, not(target_arch = "wasm32")))]
#[ctor::ctor]
fn init_logging() {
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();
}