pub enum LogFormat {
Default,
Rfc5424,
Rfc3164,
Json,
}Expand description
Selectable on-disk / on-stderr shape for emitted tracing events.
§Examples
use dynomite::core::log::LogFormat;
assert_eq!(LogFormat::default(), LogFormat::Default);Variants§
Default
Human-readable text via tracing_subscriber::fmt().
This is the historical default and is what dynomited emits
when neither the configuration nor the CLI request another
shape.
Rfc5424
Modern structured syslog per RFC 5424.
Rfc3164
BSD-style syslog per RFC 3164.
The user-facing brief originally said “RFC 3124” - that is “The Congestion Manager” and is unrelated to logging. We treat it as a typo for RFC 3164 and implement the BSD syslog shape here.
Json
Newline-delimited JSON, one event per line. Selected by either
json or ndjson.
Implementations§
Source§impl LogFormat
impl LogFormat
Sourcepub fn parse(s: &str) -> Result<Self, LogFormatParseError>
pub fn parse(s: &str) -> Result<Self, LogFormatParseError>
Parse a configuration / CLI value into a LogFormat.
The match is case-insensitive. Empty input maps to
LogFormat::Default so a YAML value of "" (or no value at
all) selects the default. The aliases json and ndjson both
map to LogFormat::Json.
§Examples
use dynomite::core::log::LogFormat;
assert_eq!(LogFormat::parse("").unwrap(), LogFormat::Default);
assert_eq!(LogFormat::parse("json").unwrap(), LogFormat::Json);
assert_eq!(LogFormat::parse("ndjson").unwrap(), LogFormat::Json);
assert!(LogFormat::parse("xml").is_err());Trait Implementations§
impl Copy for LogFormat
impl Eq for LogFormat
impl StructuralPartialEq for LogFormat
Auto Trait Implementations§
impl Freeze for LogFormat
impl RefUnwindSafe for LogFormat
impl Send for LogFormat
impl Sync for LogFormat
impl Unpin for LogFormat
impl UnsafeUnpin for LogFormat
impl UnwindSafe for LogFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.