viva_telemetry/log/level
Log levels following syslog severity levels (RFC 5424)
From most severe to least: Emergency > Alert > Critical > Err > Warning > Notice > Info > Debug > Trace
Types
Log severity levels (RFC 5424 + Trace) Note: “Error” renamed to “Err” to avoid conflict with Result.Error
pub type Level {
Emergency
Alert
Critical
Err
Warning
Notice
Info
Debug
Trace
}
Constructors
-
EmergencySystem is unusable
-
AlertAction must be taken immediately
-
CriticalCritical conditions
-
ErrError conditions
-
WarningWarning conditions
-
NoticeNormal but significant condition
-
InfoInformational messages
-
DebugDebug-level messages
-
TraceFine-grained tracing
Values
pub fn from_string(s: String) -> Result(Level, Nil)
Parse level from string (case insensitive)
pub fn is_enabled(log_level: Level, min_level: Level) -> Bool
Check if level a is at least as severe as level b
pub fn to_int(level: Level) -> Int
Convert level to numeric severity (lower = more severe)
pub fn to_short_string(level: Level) -> String
Convert level to short string (3 chars)