Skip to content

Commit

Permalink
Implement From<LevelFilter> for LogSpecification
Browse files Browse the repository at this point in the history
  • Loading branch information
Oakchris1955 committed Jun 19, 2024
1 parent cfe9093 commit 9b745fd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/log_specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,19 @@ impl std::convert::TryFrom<&String> for LogSpecification {
}
}

impl From<LevelFilter> for LogSpecification {
fn from(value: LevelFilter) -> Self {
match value {
LevelFilter::Error => LogSpecification::error(),
LevelFilter::Warn => LogSpecification::warn(),
LevelFilter::Info => LogSpecification::info(),
LevelFilter::Debug => LogSpecification::debug(),
LevelFilter::Trace => LogSpecification::trace(),
LevelFilter::Off => LogSpecification::off(),
}
}
}

fn push_err(s: &str, parse_errs: &mut String) {
if !parse_errs.is_empty() {
parse_errs.push_str("; ");
Expand Down

0 comments on commit 9b745fd

Please sign in to comment.