Skip to content

Commit

Permalink
feat: Alias level critical as fatal (#182)
Browse files Browse the repository at this point in the history
* feat: Alias level critical as fatal
  • Loading branch information
bruno-garcia authored Mar 12, 2019
1 parent 331b97b commit fc2814d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion general/src/protocol/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl FromStr for Level {
"info" | "log" => Level::Info,
"warning" => Level::Warning,
"error" => Level::Error,
"fatal" => Level::Fatal,
"fatal" | "critical" => Level::Fatal,
_ => return Err(ParseLevelError),
})
}
Expand Down Expand Up @@ -816,6 +816,13 @@ fn test_level() {
Level::Warning,
Annotated::<Level>::from_json("30").unwrap().0.unwrap()
);
assert_eq_dbg!(
Level::Fatal,
Annotated::<Level>::from_json("\"critical\"")
.unwrap()
.0
.unwrap()
);
}

#[test]
Expand Down

0 comments on commit fc2814d

Please sign in to comment.