diff --git a/Cargo.lock b/Cargo.lock index 067676b..4b205cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,6 +251,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_with", + "simple_logger", "sqlx", "thiserror", "tokio", @@ -298,6 +299,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -1397,6 +1408,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.32.2" @@ -2144,6 +2164,18 @@ dependencies = [ "time", ] +[[package]] +name = "simple_logger" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb" +dependencies = [ + "colored", + "log", + "time", + "windows-sys 0.48.0", +] + [[package]] name = "slab" version = "0.4.9" @@ -2525,6 +2557,8 @@ checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", + "libc", + "num_threads", "powerfmt", "serde", "time-core", diff --git a/Cargo.toml b/Cargo.toml index 5e93a7f..8cdaa37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,3 +79,4 @@ wasmtimer = "0.2.0" lazy_static = "1.4.0" wasm-bindgen-test = "0.3.42" wasm-bindgen = "0.2.92" +simple_logger = "5.0.0" diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 9cf6dea..863e91f 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -59,6 +59,10 @@ impl TestBundle { // Set up a test by creating an Instance and a User. Reduces Test boilerplate. pub(crate) async fn setup() -> TestBundle { + + // So we can get logs when tests fail + let _ = simple_logger::SimpleLogger::with_level(simple_logger::SimpleLogger::new(), log::LevelFilter::Debug).init(); + let instance = Instance::new("http://localhost:3001/api").await.unwrap(); // Requires the existence of the below user. let reg = RegisterSchema {