File: compile_time_config.rs

package info (click to toggle)
rust-log4rs 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: sh: 13; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 403 bytes parent folder | download
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");
}