pub struct Logger { /* private fields */ }Expand description
Central logger for safer-ring operations.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn add_output(&mut self, output: Box<dyn LogOutput>)
pub fn add_output(&mut self, output: Box<dyn LogOutput>)
Add an output destination.
Sourcepub fn log(&self, level: LogLevel, component: &str, message: &str)
pub fn log(&self, level: LogLevel, component: &str, message: &str)
Log a message at the specified level.
Sourcepub fn log_operation(
&self,
level: LogLevel,
component: &str,
operation_id: u64,
fd: Option<i32>,
message: &str,
)
pub fn log_operation( &self, level: LogLevel, component: &str, operation_id: u64, fd: Option<i32>, message: &str, )
Log a message with operation context.
Sourcepub fn log_timing(&self, component: &str, operation: &str, duration: Duration)
pub fn log_timing(&self, component: &str, operation: &str, duration: Duration)
Log a timing measurement.
Sourcepub fn log_error(&self, component: &str, error: &SaferRingError, context: &str)
pub fn log_error(&self, component: &str, error: &SaferRingError, context: &str)
Log an error with context.
Sourcepub fn get_metrics(&self) -> Result<PerformanceMetrics>
pub fn get_metrics(&self) -> Result<PerformanceMetrics>
Get performance metrics.
Sourcepub fn reset_metrics(&self) -> Result<()>
pub fn reset_metrics(&self) -> Result<()>
Reset performance metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl !UnwindSafe for Logger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more