mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-14 11:05:32 -04:00
test(sdk): Enable logging for tests
This commit is contained in:
committed by
Jonas Platte
parent
a744447bb5
commit
d810fa6883
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -2192,6 +2192,7 @@ dependencies = [
|
||||
"async-trait",
|
||||
"backoff",
|
||||
"bytes",
|
||||
"ctor",
|
||||
"dashmap",
|
||||
"dirs",
|
||||
"event-listener",
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user