1#[cfg(not(feature = "paris"))]
2use log::*;
3use simplelog::*;
4
5use std::fs::File;
6
7fn main() {
8 CombinedLogger::init(vec![
9 #[cfg(feature = "termcolor")]
10 TermLogger::new(
11 LevelFilter::Warn,
12 Config::default(),
13 TerminalMode::Mixed,
14 ColorChoice::Auto,
15 ),
16 #[cfg(not(feature = "termcolor"))]
17 SimpleLogger::new(LevelFilter::Warn, Config::default()),
18 WriteLogger::new(
19 LevelFilter::Info,
20 Config::default(),
21 File::create("my_rust_binary.log").unwrap(),
22 ),
23 ])
24 .unwrap();
25
26 error!("Bright red error");
27 info!("This only appears in the log file");
28 debug!("This level is currently not enabled for any logger");
29}