use logs::{debug, error, info, trace, warn};
debug!("This is a debug log");
trace!("This is a trace log");
info!("This is a info log");
warn!("This is a warn log");
error!("This is a error log");
use logs::{LogConfig, debug, error};
let mut config = LogConfig::disable_all();
config.debug(false);
config.error(true);
#[cfg(debug_assertions)]
config.trace(true);
config.date_format("%c").unwrap();
config.init();
debug!("This is a debug log");
error!("This is a error log");
This can be configured by reading the LOG
environment variable, which disables all output by default
# Enable all output
# Disable debug output
# ...
export LOG='all,!debug,info,!error'
use logs::LogConfig;
LogConfig::from_env().unwrap_or_default().init();