LoggerImpl

Trait LoggerImpl 

Source
pub trait LoggerImpl:
    Send
    + Sync
    + Any {
    // Required methods
    fn status(&self) -> LoggerStatus;
    fn log(&self, message: Message);
    fn as_any(&self) -> &dyn Any;
}
Expand description

The core interface for logging backends (e.g., File, Console, Network).

Implementors must be Send and Sync to allow the Logger to be shared across multiple threads. The Any bound enables runtime type introspection via the as_any method.

Required Methods§

Source

fn status(&self) -> LoggerStatus

Returns the current LoggerStatus of the logging backend.

This provides a quick check to see if the logging service is Running or has become Broken (e.g., due to a disk failure or network disconnection). The specific behavior is determined by the implementation.

Source

fn log(&self, message: Message)

Processes a single Message. The specific behavior (writing to disk, printing, etc.) is determined by the implementation.

Source

fn as_any(&self) -> &dyn Any

Returns a reference to the underlying type as Any for downcasting.

Implementors§