mirror of
https://github.com/sadoyan/aralez.git
synced 2026-10-23 06:01:35 +08:00
restructurization of logging subsystem
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use crate::logging::core::StructuredSystemLog;
|
||||
use crate::logging::elasticsearch::ElasticSearch;
|
||||
|
||||
pub trait WriteLog {
|
||||
fn writelog(&self, msg: &StructuredSystemLog);
|
||||
}
|
||||
pub fn sendlog(backend: &str, msg: &StructuredSystemLog) {
|
||||
match backend {
|
||||
"elasticsearch" => ElasticSearch.writelog(msg),
|
||||
"somewhereelse" => println!("somewhereelse"),
|
||||
_ => log::warn!("Unsupported logging mechanism : {}", backend),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user