pub struct Logger;Expand description
Callback-only logging. The library does not print or persist log records.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn register_log_listener(
listener: LogListener,
log_types: &[LogType],
) -> Result<LogSubscription>
pub fn register_log_listener( listener: LogListener, log_types: &[LogType], ) -> Result<LogSubscription>
Registers an independent subscription with a queue of 256 records.
Only explicitly listed origins are accepted, including for overflow reports. An empty type list is invalid. The returned handle must remain alive. Registration can fail if the callback thread cannot be created.
Sourcepub fn register_log_listener_with_capacity(
listener: LogListener,
log_types: &[LogType],
capacity: usize,
) -> Result<LogSubscription>
pub fn register_log_listener_with_capacity( listener: LogListener, log_types: &[LogType], capacity: usize, ) -> Result<LogSubscription>
Registers a subscription with a bounded number of queued records.
Producers never wait for queue capacity. Overflow increments
LogSubscription::dropped_count and is reported after the consumer resumes
as a synthetic log_subscription_overflow-S record using the first listed
origin. Zero capacity and an empty type list return InvalidInput.
Sourcepub fn clear_global_log_listener()
pub fn clear_global_log_listener()
Clears all global subscriptions without waiting for callbacks in progress.