Skip to content

Commit

Permalink
subscriber: dim Compact targets, matching the default formatter (#2409
Browse files Browse the repository at this point in the history
  • Loading branch information
howardjohn committed Dec 8, 2022
1 parent 60c60be commit 02903cb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,15 +1065,14 @@ where
write!(writer, "{:0>2?} ", std::thread::current().id())?;
}

let bold = writer.bold();
let dimmed = writer.dimmed();
if self.display_target {
write!(writer, "{}{}", bold.paint(meta.target()), dimmed.paint(":"))?;
write!(writer, "{}{}", dimmed.paint(meta.target()), dimmed.paint(":"))?;
}

if self.display_filename {
if let Some(filename) = meta.file() {
write!(writer, "{}{}", bold.paint(filename), dimmed.paint(":"))?;
write!(writer, "{}{}", dimmed.paint(filename), dimmed.paint(":"))?;
}
}

Expand All @@ -1082,9 +1081,9 @@ where
write!(
writer,
"{}{}{}{}",
bold.prefix(),
dimmed.prefix(),
line_number,
bold.suffix(),
dimmed.suffix(),
dimmed.paint(":")
)?;
}
Expand Down

0 comments on commit 02903cb

Please sign in to comment.