Bug fix: time-rs crate panics when changing time to local so for now the logger uses utc

This commit is contained in:
int 80h
2021-12-27 20:33:06 -05:00
parent 57113d61c4
commit 0230134e39

View File

@@ -5,11 +5,11 @@ use std::net::SocketAddr;
pub fn init(loglev: &Option<String>) -> errors::Result { pub fn init(loglev: &Option<String>) -> errors::Result {
let loglev = match loglev { let loglev = match loglev {
None => log::Level::Info, None => log::LevelFilter::Info,
Some(l) => match l.as_str() { Some(l) => match l.as_str() {
"error" => log::Level::Error, "error" => log::LevelFilter::Error,
"warn" => log::Level::Warn, "warn" => log::LevelFilter::Warn,
"info" => log::Level::Info, "info" => log::LevelFilter::Info,
_ => { _ => {
return Err(Box::new(errors::GemError( return Err(Box::new(errors::GemError(
"Incorrect log level in config file.".to_string(), "Incorrect log level in config file.".to_string(),
@@ -17,7 +17,7 @@ pub fn init(loglev: &Option<String>) -> errors::Result {
} }
}, },
}; };
simple_logger::init_with_level(loglev).unwrap(); simple_logger::SimpleLogger::new().with_level(loglev).with_utc_timestamps().init().unwrap();
Ok(()) Ok(())
} }