blob: 7a9a241dd1cdc8d98538f4bc7045596cbbe8b5ab [file] [log] [blame]
Bram Bonnéd76ddd62021-03-25 10:29:51 +01001use std::env;
2
3#[test]
4fn config_log_level() {
5 // Environment variables should be overwritten by config values.
6 env::set_var("RUST_LOG", "debug");
7
8 let init_result = logger::init(
9 logger::Config::default()
10 .with_min_level(log::Level::Trace));
11
12 assert_eq!(init_result, true);
13 // Setting the level through the Config struct should impact both host and device
14 assert_eq!(log::max_level(), log::LevelFilter::Trace);
15
16 env::remove_var("RUST_LOG");
17}