#[non_exhaustive]pub enum Format {
Auto,
Compact,
Pretty,
Json,
}Expand description
Output format for the fmt layer.
Auto is replaced at init time by Format::Pretty when the chosen sink
is a TTY and Format::Compact otherwise. Set the KAMU_LOG_FORMAT
environment variable (auto, compact, pretty, json) to override
without code changes. On wasm32, Auto resolves to Format::Json for
Cloudflare Workers Logs-friendly console output, and Format::Pretty
falls back to non-ANSI compact output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
Resolved at init time based on sink + env var.
Compact
Single-line, machine-readable text format.
Pretty
Multi-line, human-readable text format with ANSI colors.
Json
Line-delimited JSON. Required for log aggregators (Vector, Promtail, Datadog Agent, Fluent Bit).
Implementations§
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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
Mutably borrows from an owned value. Read more