#[repr(u8)]pub enum Level {
Trace = 0,
Debug = 1,
Info = 2,
Warn = 3,
Error = 4,
Off = 255,
}Expand description
Severity of a log record.
Levels are ordered from least to most severe: Self::Trace <
Self::Debug < Self::Info < Self::Warn < Self::Error.
Self::Off is greater than all real severities and is used
exclusively to disable a filter or logger entirely.
Variants§
Trace = 0
Fine-grained diagnostic information for tracing execution flow.
Debug = 1
Diagnostic information useful while debugging.
Info = 2
Informational messages about normal operation.
Warn = 3
A condition that may require attention but is not an error.
Error = 4
An error condition that prevented an operation from completing.
Off = 255
Disable logging entirely. Never attached to a real crate::Record.
Used only as a filter threshold sentinel meaning “admit nothing”.
Implementations§
Source§impl Level
impl Level
Sourcepub const ALL: [Self; 5]
pub const ALL: [Self; 5]
All real severities, ordered from least to most severe.
Excludes Self::Off. Useful for iteration in tests.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The lowercase canonical string for this level.
Returns "off" for Self::Off. This is the form emitted by
formatters by default.
Sourcepub const fn as_str_upper(self) -> &'static str
pub const fn as_str_upper(self) -> &'static str
The uppercase canonical string for this level.
Useful for human-readable formats that conventionally upper-case the severity column.
Sourcepub const fn is_enabled_at(self, threshold: Self) -> bool
pub const fn is_enabled_at(self, threshold: Self) -> bool
Returns true if this level is at least as severe as other.
Used by filters: a record at level self passes a threshold of
other when self.is_enabled_at(other) is true.