Skip to main content

ILogger

Trait ILogger 

Source
pub trait ILogger: Send + Sync {
    // Required methods
    fn info<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn debug<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn warn<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn exec<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn time(&self, msg: &str) -> TimeEvent;
}
Expand description

Logging interface with leveled async logging plus timed events.

Required Methods§

Source

fn info<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logs at info level.

Source

fn debug<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logs at debug level (suppressed by ConsoleLogger in production).

Source

fn warn<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logs at warn level.

Source

fn error<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logs at error level.

Source

fn exec<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logs an executed action at info level with an exec marker.

Source

fn time(&self, msg: &str) -> TimeEvent

Starts a TimeEvent that logs its duration when ended.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§