restructurization of logging subsystem

This commit is contained in:
Ara Sadoyan
2026-09-22 18:25:52 +02:00
parent 4cd9b459b0
commit 639365c43b
13 changed files with 168 additions and 9 deletions
+13
View File
@@ -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),
}
}