You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The crate tracing-subscriber might switch to using owo-colors. ( tokio-rs/tracing#2759 )
I tried implementing it, but stumbled upon a tricky case. Essentially tracing-subscriber is outputting values to a core::fmt::Write, and it wants to call fmt_prefix before that and fmt_suffix after that.[1]
However, the fmt_prefix and fmt_suffix methods assume that one has a std::fmt::Formatter. Which isn't the case here. The code is roughly
write!(writer, "{}", style.prefix())?;// Directly prints to the writer. No instance of std::fmt::Formatter exists here.self.timer.format_time(writer)write!(writer, "{} ", style.suffix())?;
Would it be reasonable to change the fmt_prefix/fmt_suffix methods to accept anything that implements fmt::Write? Or is there another, potentially better solution?
The crate tracing-subscriber might switch to using owo-colors. ( tokio-rs/tracing#2759 )
I tried implementing it, but stumbled upon a tricky case. Essentially tracing-subscriber is outputting values to a
core::fmt::Write
, and it wants to callfmt_prefix
before that andfmt_suffix
after that.[1]However, the
fmt_prefix
andfmt_suffix
methods assume that one has astd::fmt::Formatter
. Which isn't the case here. The code is roughlyWould it be reasonable to change the
fmt_prefix
/fmt_suffix
methods to accept anything that implementsfmt::Write
? Or is there another, potentially better solution?[1]
https://github.com/tokio-rs/tracing/blob/908cc432a5994f6e17c8f36e13c217dc40085704/tracing-subscriber/src/fmt/format/mod.rs#L859-L868
The text was updated successfully, but these errors were encountered: