forked from estk/log4rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: serde deserialization and triggering on size trigger, cleanup, …
…MSRV bump, cleanup color ctrl test
- Loading branch information
Showing
7 changed files
with
364 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use log::{error, info}; | ||
use log4rs; | ||
use serde_yaml; | ||
use std::env; | ||
|
||
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(); | ||
|
||
let no_color = match env::var("NO_COLOR") { | ||
Ok(no_color) => no_color, | ||
Err(_) => "0".to_string(), | ||
}; | ||
let clicolor_force = match env::var("CLICOLOR_FORCE") { | ||
Ok(clicolor_force) => clicolor_force, | ||
Err(_) => "0".to_string(), | ||
}; | ||
let cli_color = match env::var("CLICOLOR") { | ||
Ok(cli_color) => cli_color, | ||
Err(_) => "0".to_string(), | ||
}; | ||
info!("NO_COLOR: {}, CLICOLOR_FORCE: {}, CLICOLOR: {}", no_color, clicolor_force, cli_color); | ||
error!("NO_COLOR: {}, CLICOLOR_FORCE: {}, CLICOLOR: {}", no_color, clicolor_force, cli_color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.