Skip to content

Commit

Permalink
fix log format output
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Sep 12, 2024
1 parent 4cd3000 commit feeffe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "1.8.1"
version = "1.8.2"
edition = "2021"
authors = ["baoyachi <liaoymxsdl@gmail.com>"]
description = "A simple log. It's really simple use"
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,18 +656,18 @@ fn encoder(time_format: Option<&String>, color: bool) -> PatternEncoder {
};

let color_level = match color {
true => "h({l})",
false => "l",
true => "{h({l:5})}",
false => "{l:5}",
};
let mut pattern = format!("{{d({})}} [{{{}}}] ", time_format, color_level);
let mut pattern = format!("{{d({})}} [{}] ", time_format, color_level);

#[cfg(feature = "target")]
{
pattern += "[{t}] <{f}:{L}>:{m}{n}";
pattern += "[{t:7}] <{M}:{L}>:{m}{n}";
}
#[cfg(not(feature = "target"))]
{
pattern += "<{f}:{L}>:{m}{n}";
pattern += "<{M}:{L}>:{m}{n}";
}

PatternEncoder::new(pattern.as_str())
Expand Down

0 comments on commit feeffe3

Please sign in to comment.