Refactor async logging to synchronous; improve error handling consistency across modules.

This commit is contained in:
Kai Börnert
2026-04-13 17:03:47 +02:00
parent 964bdb0454
commit 8ce00c9d95
12 changed files with 104 additions and 121 deletions

View File

@@ -3,7 +3,7 @@ use alloc::vec::Vec;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::blocking_mutex::Mutex as BlockingMutex;
use embassy_sync::mutex::Mutex;
use log::{LevelFilter, Log, Metadata, Record};
use log::{error, LevelFilter, Log, Metadata, Record};
pub struct InterceptorLogger {
// Async mutex for start/stop capture from async context
@@ -34,9 +34,13 @@ impl InterceptorLogger {
}
pub fn init(&'static self) {
log::set_logger(self)
.map(|()| log::set_max_level(LevelFilter::Info))
.unwrap();
match log::set_logger(self)
.map(|()| log::set_max_level(LevelFilter::Info)) {
Ok(()) => {}
Err(e) => {
error!("Logger already set: {}", e);
}
}
}
}