Add constructor for LogSettings (#67)
* add constructor for LogSettings
This commit is contained in:
parent
9a8400f4ce
commit
4705cc213b
@ -37,6 +37,27 @@ pub struct LoggerSettings {
|
|||||||
level: Level,
|
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)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub enum LoggerFormat {
|
pub enum LoggerFormat {
|
||||||
Json,
|
Json,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user