refactor for tracing and api logging

This commit is contained in:
John Smith
2022-06-08 09:33:41 -04:00
parent 1d8c63786a
commit bfe0315af1
9 changed files with 139 additions and 238 deletions

View File

@@ -179,6 +179,19 @@ impl VeilidLogLevel {
}
}
impl fmt::Display for VeilidLogLevel {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
let text = match self {
Self::Error => "ERROR",
Self::Warn => "WARN",
Self::Info => "INFO",
Self::Debug => "DEBUG",
Self::Trace => "TRACE",
};
write!(f, "{}", text)
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VeilidStateLog {
pub log_level: VeilidLogLevel,