Skip to main content

level_from_bracketed

Function level_from_bracketed 

Source
pub fn level_from_bracketed(s: &str) -> Option<LogLevel>
Expand description

The LogLevel inside a header’s [LEVEL] field, or None when the brackets are missing or hold no level the switch knows.

LogLevel’s own FromStr is the switch’s case-sensitive LEVELS[] lookup and the log spells the level in upper case, so the names are compared here instead: folding the name would allocate on every header line.