Skip to content

Commit

Permalink
new: added support for integer log levels (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus authored Mar 20, 2024
1 parent e1d1296 commit 6efd977
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ categories = ["command-line-utilities"]
description = "Utility for viewing json-formatted log files."
keywords = ["cli", "human", "log"]
name = "hl"
version = "0.27.0-beta.3.1"
version = "0.27.0-beta.3.2"
edition = "2021"
build = "build.rs"

Expand Down
6 changes: 5 additions & 1 deletion src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,11 @@ impl FieldSettings {
}
}
Self::Level(i) => {
to.level = value.parse().ok().and_then(|x: &'a str| ps.level[i].get(x).cloned());
let value = match value.kind() {
ValueKind::QuotedString => value.parse().ok().unwrap_or_else(|| value.raw_str()),
_ => value.raw_str(),
};
to.level = ps.level[i].get(value).cloned();
}
Self::Logger => to.logger = value.parse().ok(),
Self::Message => to.message = Some(value),
Expand Down

0 comments on commit 6efd977

Please sign in to comment.