1 2 3 4 5 6 7 8 9 10
use std::sync::Once; static INIT: Once = Once::new(); pub fn init_logger() { INIT.call_once(|| { env_logger::builder() .is_test(true) .init(); }); }