Optimize structured logging.

This commit is contained in:
Ara Sadoyan
2026-09-26 18:49:37 +02:00
parent d623a2da72
commit 1fab52456f
-4
View File
@@ -159,9 +159,6 @@ pub async fn log_builder(conf: &AppConfig, location: &Option<String>) {
return; return;
} }
if let Some(location) = location { if let Some(location) = location {
// let parts: Vec<&str> = location.splitn(4, ',').map(|s| s.trim()).collect();
// let path = parts.get(0).expect("Syntax error, could not get path for log files");
let parts: Vec<&str> = location.split(',').map(|s| s.trim()).collect(); let parts: Vec<&str> = location.split(',').map(|s| s.trim()).collect();
let path = match parts.get(0).filter(|s| !s.is_empty()) { let path = match parts.get(0).filter(|s| !s.is_empty()) {
Some(p) => p, Some(p) => p,
@@ -311,7 +308,6 @@ pub async fn init_structured_log() {
let (tx, rx) = mpsc::channel::<StructuredSystemLog>(LOG_BUFFER); let (tx, rx) = mpsc::channel::<StructuredSystemLog>(LOG_BUFFER);
let _ = SYSTEM_LOG_SENDER.set(tx); let _ = SYSTEM_LOG_SENDER.set(tx);
let backend = get_backend(); let backend = get_backend();
// Start backend receiver directly without double-channel forwarding
start_logging_backend(backend, rx); start_logging_backend(backend, rx);
} }