default_colors/
default_colors.rs

1#[cfg(all(feature = "termcolor", not(feature = "paris")))]
2use log::*;
3#[cfg(feature = "termcolor")]
4use simplelog::*;
5
6#[cfg(feature = "termcolor")]
7fn main() {
8    TermLogger::init(
9        LevelFilter::Trace,
10        Config::default(),
11        TerminalMode::Stdout,
12        ColorChoice::Auto,
13    )
14    .unwrap();
15    error!("Red error");
16    warn!("Yellow warning");
17    info!("Blue info");
18    debug!("Cyan debug");
19    trace!("White trace");
20}
21
22#[cfg(not(feature = "termcolor"))]
23fn main() {
24    println!("this example requires the termcolor feature.");
25}