Add date formatting for logger

Flon a cute
master
not manx 4 years ago
parent 882c670885
commit 0ac42af9fd
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

1
.gitignore vendored

@ -1,3 +1,4 @@
*~
target/
rel.drawio.png
src/config/build_cfg.rs

@ -5,4 +5,4 @@ timeout = 5
# Logging options
[log]
default_time_local = false
default_time_local = false

@ -1,34 +0,0 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(dead_code)]
use std::borrow::Cow;
#[derive(Debug, Clone)]
#[allow(non_camel_case_types)]
pub struct Config {
pub hot: _Config__hot,
pub log: _Config__log,
}
#[derive(Debug, Clone)]
#[allow(non_camel_case_types)]
pub struct _Config__hot {
pub backlog: i64,
pub timeout: i64,
}
#[derive(Debug, Clone)]
#[allow(non_camel_case_types)]
pub struct _Config__log {
pub default_time_local: bool,
}
pub const CONFIG: Config = Config {
hot: _Config__hot {
backlog: 100,
timeout: 5,
},
log: _Config__log {
default_time_local: false,
},
};

@ -257,8 +257,8 @@ impl Logger
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
{
match self {
Self::Local(l) => write!(f, "{}", l),
Self::Utc(l) => write!(f, "{}", l),
Self::Local(l) => write!(f, "{}", l.format("%Y-%m-%d %H:%M:%S %Z")),
Self::Utc(l) => write!(f, "{}", l.format("%Y-%m-%d %H:%M:%S %Z")),
}
}
}

Loading…
Cancel
Save