Skip to main content

parse_log_level_str

Function parse_log_level_str 

Source
pub fn parse_log_level_str(s: &str) -> Result<LogLevelOrStdout, String>
Expand description

Parse a single log-level token into a LogLevelOrStdout.

Accepts error|warn|info|debug|trace|stdout, case-insensitively; any other value is an error.

use dora_cli::output::parse_log_level_str;

assert!(parse_log_level_str("INFO").is_ok());
assert!(parse_log_level_str("stdout").is_ok());
assert!(parse_log_level_str("verbose").is_err());