CloudLogger

Trait CloudLogger 

Source
pub trait CloudLogger: Send + Sync {
    // Required methods
    fn log<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 str,
        level: LogLevel,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn log_structured<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entry: &'life1 LogEntry,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn log_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entries: &'life1 [LogEntry],
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Unified trait for cloud logging.

Required Methods§

Source

fn log<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 str, level: LogLevel, ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Writes a simple log message.

§Arguments
  • message - The log message
  • level - The log level
§Errors

Returns CloudError::LogWrite if the write operation fails.

Source

fn log_structured<'life0, 'life1, 'async_trait>( &'life0 self, entry: &'life1 LogEntry, ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Writes a structured log entry.

§Arguments
  • entry - The structured log entry
§Errors

Returns CloudError::LogWrite if the write operation fails.

Provided Methods§

Source

fn log_batch<'life0, 'life1, 'async_trait>( &'life0 self, entries: &'life1 [LogEntry], ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Writes a batch of log entries.

§Arguments
  • entries - Slice of log entries to write
§Errors

Returns CloudError::LogWrite if the write operation fails.

Implementors§