pub enum LogFormat {
Json,
Logfmt,
Plain,
}Expand description
Selects which line parser the dispatcher uses.
Default is LogFormat::Json — the v0.1.0 default carried forward
so callers that don’t explicitly pick a format get the same behavior
they used to.
Variants§
Json
Structured JSON, one object per line. The v0.1.0 default.
Logfmt
logfmt — key=value pairs, see parsers::logfmt.
Plain
Unstructured plaintext. The whole line becomes LogEntry::message.
Implementations§
Source§impl LogFormat
impl LogFormat
Sourcepub const ALL: &'static [Self]
pub const ALL: &'static [Self]
Every LogFormat variant, in declaration order.
Use this when you need to enumerate all supported formats without
hard-coding the list at a call site — for example, the API
/version endpoint reports this slice so clients know what the
running binary accepts. Adding a new variant here automatically
propagates to every such consumer.
Sourcepub fn from_name(s: &str) -> Option<Self>
pub fn from_name(s: &str) -> Option<Self>
Parse a CLI-style format name. Case-insensitive.
Returns None for unrecognized names. The CLI wraps this in a
clap value parser that surfaces the unknown name as a usage
error; library consumers can call it directly.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
Canonical short name used in CLI flags, configuration, and any
future Display-based contexts. Always one lowercase word that
round-trips through Self::from_name.