Skip to content

Commit

Permalink
subscriber: fix missing event fields in Compact formatter
Browse files Browse the repository at this point in the history
The line of code that prints the event's fields (including its message)
was accidentally deleted in 0a16972,
while backporting PR #1696 from `master` (where the `Compact`) formatter
implementation is significantly different.

This branch puts it back.

Fixes #1741
  • Loading branch information
hawkw committed Nov 29, 2021
1 parent b3f508d commit d7a2e42
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,6 @@ where
write!(writer, "{:0>2?} ", std::thread::current().id())?;
}

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

let fmt_ctx = {
#[cfg(feature = "ansi")]
{
Expand All @@ -927,6 +918,17 @@ where
};
write!(writer, "{}", fmt_ctx)?;

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

ctx.format_fields(writer.by_ref(), event)?;

let dimmed = writer.dimmed();
for span in ctx
.event_scope()
Expand Down

0 comments on commit d7a2e42

Please sign in to comment.