Skip to main content

LogMapper

Trait LogMapper 

Source
pub trait LogMapper:
    Send
    + Sync
    + Clone
    + Default
    + 'static {
    // Required method
    fn map(&self, context: LogContext, entry: Value) -> Value
       where Self: Sized;
}
Expand description

Trait for mapping a raw JSON log entry to a structured format compatible with Google Cloud Logging.

You can implement this to transform log data (e.g., enrich with labels or restructure).

Required Methods§

Source

fn map(&self, context: LogContext, entry: Value) -> Value
where Self: Sized,

Converts a raw log entry into a structured JSON value using context information.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§