log4rs 1.4.0

A highly configurable multi-output logging implementation for the `log` facade
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use log::{error, info, trace};
use log4rs;
use serde_yaml;

fn main() {
    let config_str = include_str!("sample_config.yml");
    let config = serde_yaml::from_str(config_str).unwrap();
    log4rs::init_raw_config(config).unwrap();

    info!("Goes to console, file and rolling file");
    error!("Goes to console, file and rolling file");
    trace!("Doesn't go to console as it is filtered out");
}