Skip to content

Commit 38c1d8b

Browse files
howardjohnhawkw
authored andcommitted
subscriber: dim Compact targets, matching the default formatter (#2409)
## Motivation Fixes #2408 ## Solution Just switch to use `dim` Before: ![2022-12-08_13-58-40](https://user-images.githubusercontent.com/623453/206576169-63ee4e20-b56f-4c63-a9b3-80ba2e97eec9.png) After: ![2022-12-08_13-55-36](https://user-images.githubusercontent.com/623453/206576055-878d360f-7b95-4e18-bc31-4fb6f1b71a3a.png) Full mode for comparison: ![2022-12-08_13-55-48](https://user-images.githubusercontent.com/623453/206576054-6e38852c-cb3a-4b84-98e5-50463cdb5073.png)
1 parent ac8ddf4 commit 38c1d8b

File tree

1 file changed

+5
-6
lines changed
  • tracing-subscriber/src/fmt/format

1 file changed

+5
-6
lines changed

tracing-subscriber/src/fmt/format/mod.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1082,12 +1082,11 @@ where
10821082
};
10831083
write!(writer, "{}", fmt_ctx)?;
10841084

1085-
let bold = writer.bold();
10861085
let dimmed = writer.dimmed();
10871086

10881087
let mut needs_space = false;
10891088
if self.display_target {
1090-
write!(writer, "{}{}", bold.paint(meta.target()), dimmed.paint(":"))?;
1089+
write!(writer, "{}{}", dimmed.paint(meta.target()), dimmed.paint(":"))?;
10911090
needs_space = true;
10921091
}
10931092

@@ -1096,7 +1095,7 @@ where
10961095
if self.display_target {
10971096
writer.write_char(' ')?;
10981097
}
1099-
write!(writer, "{}{}", bold.paint(filename), dimmed.paint(":"))?;
1098+
write!(writer, "{}{}", dimmed.paint(filename), dimmed.paint(":"))?;
11001099
needs_space = true;
11011100
}
11021101
}
@@ -1106,9 +1105,9 @@ where
11061105
write!(
11071106
writer,
11081107
"{}{}{}{}",
1109-
bold.prefix(),
1108+
dimmed.prefix(),
11101109
line_number,
1111-
bold.suffix(),
1110+
dimmed.suffix(),
11121111
dimmed.paint(":")
11131112
)?;
11141113
needs_space = true;
@@ -2039,7 +2038,7 @@ pub(super) mod test {
20392038
#[cfg(feature = "ansi")]
20402039
#[test]
20412040
fn with_ansi_true() {
2042-
let expected = "\u{1b}[2mfake time\u{1b}[0m \u{1b}[32m INFO\u{1b}[0m \u{1b}[1mtracing_subscriber::fmt::format::test\u{1b}[0m\u{1b}[2m:\u{1b}[0m hello\n";
2041+
let expected = "\u{1b}[2mfake time\u{1b}[0m \u{1b}[32m INFO\u{1b}[0m \u{1b}[2mtracing_subscriber::fmt::format::test\u{1b}[0m\u{1b}[2m:\u{1b}[0m hello\n";
20432042
test_ansi(true, expected, crate::fmt::Subscriber::builder().compact())
20442043
}
20452044

0 commit comments

Comments
 (0)