Skip to main content

LogProvider

Trait LogProvider 

Source
pub trait LogProvider:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn on_log(&self, _message: &LogMessage) { ... }
    fn upload_collected_logs<'a>(
        &'a self,
        _archive: CollectedLogArchive,
    ) -> BoxFuture<'a, Result<(), ProviderError>> { ... }
}
Expand description

Realtime plus diagnostic log upload contract.

§Re-entrancy

on_log is called synchronously inside the log dispatch path. Implementations must not emit lingxia log events (e.g. via info!() or tracing) from within on_log, as this would re-enter the log pipeline. The SDK guards against same-thread re-entrancy, but cross-thread re-entrancy is not detected and may cause unbounded recursion on multi-threaded runtimes.

Provided Methods§

Source

fn on_log(&self, _message: &LogMessage)

Realtime log hook.

Called synchronously for every structured log event that enters the SDK log pipeline. Implementations are expected to enqueue quickly and avoid blocking I/O. Must not emit lingxia log events — see trait-level re-entrancy note.

Source

fn upload_collected_logs<'a>( &'a self, _archive: CollectedLogArchive, ) -> BoxFuture<'a, Result<(), ProviderError>>

Upload a collected compressed log archive for diagnostics.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§