1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use once_cell::sync::OnceCell;
pub static LOG_LEVEL: OnceCell<LogLevel> = OnceCell::new();
pub fn log_level() -> &'static LogLevel { LOG_LEVEL.get_or_init(|| LogLevel::Info) }
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum LogLevel {
Trace,
Debug,
Info,
Warn,
Error,
Off,
}