pub trait FormatterPort: Send + Sync {
// Required method
fn format(&self, entry: &LogEntry) -> Result<String, ObservabilityError>;
}Expand description
Port for formatting log entries
Different formatters can be plugged in:
- JsonFormatter (structured JSON output)
- PlainTextFormatter (human-readable text)
- CompactFormatter (single-line JSON)
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".