pub struct SessionAwareLogger { /* private fields */ }Expand description
Session-aware logger that can send messages to sessions with filtering
This logger is designed to work with session contexts that implement logging level checking and message sending capabilities.
Implementations§
Source§impl SessionAwareLogger
impl SessionAwareLogger
Sourcepub fn send_to_target<T: LoggingTarget>(&self, target: &T)
pub fn send_to_target<T: LoggingTarget>(&self, target: &T)
Send this log message to the specified target if it passes the target’s logging level filter
Sourcepub fn send_to_targets<T: LoggingTarget>(&self, targets: &[&T])
pub fn send_to_targets<T: LoggingTarget>(&self, targets: &[&T])
Send this log message to multiple targets with per-target filtering
Sourcepub fn would_send_to_target<T: LoggingTarget>(&self, target: &T) -> bool
pub fn would_send_to_target<T: LoggingTarget>(&self, target: &T) -> bool
Check if this message would be sent to the given target
Sourcepub fn format_message(&self) -> String
pub fn format_message(&self) -> String
Get the formatted message that would be sent
Sourcepub fn level_to_string(&self) -> &'static str
pub fn level_to_string(&self) -> &'static str
Convert logging level to string representation
Trait Implementations§
Source§impl Debug for SessionAwareLogger
impl Debug for SessionAwareLogger
Source§impl HasLogFormat for SessionAwareLogger
impl HasLogFormat for SessionAwareLogger
Source§impl HasLogLevel for SessionAwareLogger
impl HasLogLevel for SessionAwareLogger
Source§fn level(&self) -> LoggingLevel
fn level(&self) -> LoggingLevel
The current or target logging level
Source§fn should_log(&self, message_level: LoggingLevel) -> bool
fn should_log(&self, message_level: LoggingLevel) -> bool
Check if a message at the given level should be logged
Source§impl HasLogTransport for SessionAwareLogger
impl HasLogTransport for SessionAwareLogger
Source§fn batch_size(&self) -> Option<usize>
fn batch_size(&self) -> Option<usize>
Optional batching configuration
Source§fn should_deliver(&self, threshold_level: LoggingLevel) -> bool
fn should_deliver(&self, threshold_level: LoggingLevel) -> bool
Optional filtering criteria
Auto Trait Implementations§
impl Freeze for SessionAwareLogger
impl RefUnwindSafe for SessionAwareLogger
impl Send for SessionAwareLogger
impl Sync for SessionAwareLogger
impl Unpin for SessionAwareLogger
impl UnwindSafe for SessionAwareLogger
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
Source§impl<T> LoggerDefinition for T
impl<T> LoggerDefinition for T
Source§fn to_message_notification(&self) -> LoggingMessageNotification
fn to_message_notification(&self) -> LoggingMessageNotification
Convert this logger definition to a LoggingMessageNotification
Source§fn to_set_level_request(&self) -> SetLevelRequest
fn to_set_level_request(&self) -> SetLevelRequest
Convert this logger definition to a SetLevelRequest