Ensure INFO logs are coloured white

pull/1/head
sgoudham 3 years ago
parent deaab37239
commit e046be656e
Signed by: hammy
GPG Key ID: 44E818FD5457EEA4

@ -184,8 +184,20 @@ macro_rules! debug {
#[macro_export] #[macro_export]
macro_rules! info { macro_rules! info {
($str:expr) => { ($str:expr) => {
use std::io::Write;
use termcolor::WriteColor;
let now = chrono::Utc::now().format("%Y-%M-%dT%H:%M:%S%z"); let now = chrono::Utc::now().format("%Y-%M-%dT%H:%M:%S%z");
println!("{}", format!("[{} {}] {}", now, rall::Level::INFO, $str)); let mut stream = termcolor::StandardStream::stdout(termcolor::ColorChoice::Always);
stream
.set_color(
termcolor::ColorSpec::new()
.set_fg(Some(termcolor::Color::White))
.set_bold(true),
)
.unwrap();
writeln!(&mut stream, "[{} {}] {}", now, rall::Level::INFO, $str).unwrap();
stream.reset().unwrap();
}; };
} }

Loading…
Cancel
Save