Skip to content

Commit

Permalink
subscriber: fix buggy format with module disabled (#481)
Browse files Browse the repository at this point in the history
Closes #476
  • Loading branch information
yaahc authored and hawkw committed Dec 20, 2019
1 parent 11dab1e commit e930f05
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,10 @@ where
}
};

write!(
writer,
"{} {}{}: ",
fmt_level,
full_ctx,
if self.display_target {
meta.target()
} else {
""
}
)?;
write!(writer, "{} {}", fmt_level, full_ctx)?;
if self.display_target {
write!(writer, "{}: ", meta.target())?;
}
ctx.format_fields(writer, event)?;
writeln!(writer)
}
Expand Down Expand Up @@ -308,17 +301,10 @@ where
(FmtLevel::new(meta.level()), FmtCtx::new(&ctx))
}
};
write!(
writer,
"{} {}{}: ",
fmt_level,
fmt_ctx,
if self.display_target {
meta.target()
} else {
""
}
)?;
write!(writer, "{} {}", fmt_level, fmt_ctx)?;
if self.display_target {
write!(writer, "{}:", meta.target())?;
}
ctx.format_fields(writer, event)?;
let span = ctx.ctx.current_span();
if let Some(id) = span.id() {
Expand Down

0 comments on commit e930f05

Please sign in to comment.