diff --git a/src/logs.rs b/src/logs.rs index 1ffd3e0..2727784 100644 --- a/src/logs.rs +++ b/src/logs.rs @@ -1,10 +1,17 @@ use env_logger::{Builder, Env, Target}; +use std::io::Write; pub fn init_log_system() { - let env = Env::new() - .filter_or(crate::LOG_LEVEL_ENV_VAR, "warn") - .write_style_or(crate::LOG_STYLE_ENV_VAR, "never"); + let env = Env::new().filter_or(crate::LOG_LEVEL_ENV_VAR, "warn"); let mut builder = Builder::from_env(env); + builder.format(|buf, record| { + writeln!( + buf, + "{}: {}", + record.level().to_string().to_lowercase(), + record.args() + ) + }); builder.target(Target::Stderr); builder.init(); } diff --git a/src/main.rs b/src/main.rs index 028e8ea..aba6272 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,6 @@ use stdin_reader::StdinReader; const DEFAULT_BUFF_SIZE: usize = 1024; const LOG_LEVEL_ENV_VAR: &str = "OPENSMTPD_FILTER_DKIMOUT_LOG_LEVEL"; -const LOG_STYLE_ENV_VAR: &str = "OPENSMTPD_FILTER_DKIMOUT_LOG_STYLE"; #[macro_export] macro_rules! display_bytes {