// can only be called once, impossible to test all codepaths
can only be called once, impossible to test all codepaths
can only be called once impossible to test all codepaths
fn init(config: &LoggerConfig) {
        unsafe {
            LOGGER.log_level = if config.trace {
                log::LevelFilter::Trace
            } else if config.debug {
                log::LevelFilter::Debug
            } else {
                log::LevelFilter::Info
            };
            // Only enable colored/emoji output on interactive terminal
            if atty::is(atty::Stream::Stderr) {
                LOGGER.color_enabled = !config.no_color;
                LOGGER.emoji_enabled = !config.no_emoji;
            }
            let logger: &'static SimpleLogger = &LOGGER;
            log::set_logger(logger)
                .map(|()| log::set_max_level(logger.log_level))
                .unwrap();
        }
    }
fn init ( config : & LoggerConfig ) { unsafe { LOGGER . log_level = if config . trace { log :: LevelFilter :: Trace } else if config . debug { log :: LevelFilter :: Debug } else { log :: LevelFilter :: Info } ; // Only enable colored/emoji output on interactive terminal if atty :: is ( atty :: Stream :: Stderr ) { LOGGER . color_enabled = ! config . no_color ; LOGGER . emoji_enabled = ! config . no_emoji ; } let logger : & ' static SimpleLogger = & LOGGER ; log :: set_logger ( logger ) . map ( | ( ) | log :: set_max_level ( logger . log_level ) ) . unwrap ( ) ; } }
can only be called once, impossible to test all codepaths
can only be called once impossible to test all codepaths
config
&LoggerConfig