Skip to content

Commit 1009194

Browse files
committed
use simplelogger in client
1 parent ba6f8fd commit 1009194

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tmc-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ schemars = "0.8"
2424
walkdir = "2"
2525

2626
[dev-dependencies]
27-
env_logger = "0.8"
27+
simple_logger = "1"
2828
mockito = "0.28"
2929
dotenv = "0.15"

tmc-client/src/tmc_client.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,14 +810,20 @@ impl AsRef<TmcCore> for TmcClient {
810810
mod test {
811811
use super::*;
812812
use mockito::{mock, Matcher};
813-
use std::env;
814813

815814
// sets up mock-authenticated TmcClient and logging
816815
fn init() -> (TmcClient, String) {
817-
if env::var("RUST_LOG").is_err() {
818-
env::set_var("RUST_LOG", "debug,hyper=warn,tokio_reactor=warn");
819-
}
820-
let _ = env_logger::builder().is_test(true).try_init();
816+
use log::*;
817+
use simple_logger::*;
818+
let _ = SimpleLogger::new()
819+
.with_level(LevelFilter::Debug)
820+
// mockito does some logging
821+
.with_module_level("mockito", LevelFilter::Warn)
822+
// reqwest does a lot of logging
823+
.with_module_level("reqwest", LevelFilter::Warn)
824+
// hyper does a lot of logging
825+
.with_module_level("hyper", LevelFilter::Warn)
826+
.init();
821827

822828
let _m = mock("GET", "/api/v8/application/client_name/credentials")
823829
.match_query(Matcher::Any)

0 commit comments

Comments
 (0)