pub trait LogExporter: Send + Sync + Debug {
    // Required method
    fn export<'life0, 'async_trait>(
        &'life0 mut self,
        batch: Vec<LogData>
    ) -> Pin<Box<dyn Future<Output = LogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn shutdown(&mut self) { ... }
    fn event_enabled(
        &self,
        _level: Severity,
        _target: &str,
        _name: &str
    ) -> bool { ... }
}
Available on crate feature logs only.
Expand description

LogExporter defines the interface that log exporters should implement.

Required Methods§

source

fn export<'life0, 'async_trait>( &'life0 mut self, batch: Vec<LogData> ) -> Pin<Box<dyn Future<Output = LogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Exports a batch of LogData.

Provided Methods§

source

fn shutdown(&mut self)

Shuts down the exporter.

source

fn event_enabled(&self, _level: Severity, _target: &str, _name: &str) -> bool

Available on crate feature logs_level_enabled only.

Chek if logs are enabled.

Implementors§

source§

impl LogExporter for InMemoryLogsExporter

Available on crate feature testing or test only.