fmt: weird formatting with targets disabled #476
Labels
crate/fmt
Related to the `tracing-fmt` crate
good first issue
Good for newcomers
kind/bug
Something isn't working
Bug Report
Crates
tracing-subscriber
Description
When configuring a formatter with
events are formatted with a second space and colon following the span context, like this:
This doesn't look great. We should fix it.
The issue is in this code:
tracing/tracing-subscriber/src/fmt/format/mod.rs
Lines 311 to 321 in fc3ab4c
Notice how the
:
is part of the format string, so it's always output, even when we don't print a target.We should change this so that when
display_targets
is not set, we don't include the:
. We could do that by putting theif
around thewrite!
macro, instead, and having two separate format specs depending on whether or not we're including a target.The text was updated successfully, but these errors were encountered: