init_with_level.rs 226 B

123456789
  1. use log::LevelFilter;
  2. use simple_logger::SimpleLogger;
  3. fn main() {
  4. SimpleLogger::new().with_level(LevelFilter::Warn).init().unwrap();
  5. log::warn!("This will be logged.");
  6. log::info!("This will NOT be logged.");
  7. }