pub enum Level {
Trace = 0,
Debug = 1,
Info = 2,
Warning = 3,
Error = 4,
Fatal = 5,
Panic = 6,
}Expand description
Log level definition.
Loggers evaluates these in descending order, so f.ex. a log level
of Level::Info includes Level::Warning and Level::Panic,
but not Level::Debug.
Variants§
Trace = 0
Used for tracing code execution path; updates at this level get additional built-in attributes such as logger ID, caller filename and line number. Rasant will also log trace updates for some operations, such as sink additions and log level changes.
Debug = 1
Messages useful for debugging and troubleshooting.
Info = 2
Normal operation updates.
Warning = 3
Unusual events that might require attention, but do not otherwise impact normal operation.
Error = 4
Error updates.
Fatal = 5
Appplication-wide errors from which recovery is impoosible.
Panic = 6
Similar to Level::Fatal, but the application panics right after logging the update.
Implementations§
Source§impl Level
impl Level
Sourcepub fn covers(&self, other: &Level) -> bool
pub fn covers(&self, other: &Level) -> bool
Evaluates whether this level covers another - i.e. it’s at the same, or higher level.
Sourcepub fn includes(&self, other: &Level) -> bool
pub fn includes(&self, other: &Level) -> bool
Evaluates whether this level is covered by another.
Sourcepub fn color(&self) -> Color
pub fn color(&self) -> Color
Returns a color associated with a given level, useful mostly for pretty printing.
Sourcepub fn as_long_str(&self) -> &'static str
pub fn as_long_str(&self) -> &'static str
Returns a full uppercase name for the level.
Sourcepub fn as_short_str(&self) -> &'static str
pub fn as_short_str(&self) -> &'static str
Returns a short, three-letter name for the level.
Sourcepub fn syslog_severity(&self) -> u16
pub fn syslog_severity(&self) -> u16
Returns a syslog severity for the level.