1 2 3 4 5 6 7 8 9 10 11 12 13
use lazy_static::lazy_static; use std::sync::Once; lazy_static! { static ref INIT: Once = Once::new(); } pub fn start_logger() { INIT.call_once(|| { // install global collector configured based on RUST_LOG env var. tracing_subscriber::fmt::init(); }); }