Add constructor for LogSettings (#67)

* add constructor for LogSettings
This commit is contained in:
Al Liu 2023-02-06 19:23:25 +08:00 committed by GitHub
parent 9a8400f4ce
commit 4705cc213b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -37,6 +37,27 @@ pub struct LoggerSettings {
level: Level,
}
impl Default for LoggerSettings {
fn default() -> Self {
Self {
backend: LoggerBackend::Stdout,
format: LoggerFormat::Json,
level: Level::DEBUG,
}
}
}
impl LoggerSettings {
#[inline]
pub const fn new(backend: LoggerBackend, format: LoggerFormat, level: Level) -> Self {
Self {
backend,
format,
level,
}
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum LoggerFormat {
Json,