1 2 3 4 5 6 7 8 9 10 11
use std::sync::OnceLock; static logger_setup: OnceLock<bool> = OnceLock::new(); pub fn setup_logger() { logger_setup.get_or_init(|| { tracing_subscriber::fmt() .with_max_level(tracing::Level::TRACE) .init(); true }); }