tracing icon indicating copy to clipboard operation
tracing copied to clipboard

enabled! consults log::log_enabled! when appropriate

Open kmahar opened this issue 2 years ago • 1 comments

This is an attempt at fixing #2036. I am not confident this is the right way to do this and I have a few questions, but I figured I would put up a PR to get some guidance and feedback.

Motivation

Libraries and applications can use enabled! to determine whether anyone is actually going to consume an expensive event before constructing it. However, currently enabled! only factors in whether the event will be consumed as a tracing event, and not whether it would be consumed as a log message.

Solution

Update the macro to consult log::log_enabled in cases where log or log-always is enabled and the event is not going to be emitted as a tracing event.

kmahar avatar Jul 08 '22 16:07 kmahar

Sorry, this is taking me a minute to review. I'm trying to remember how Interest and log interact here, especially across feature flags.

davidbarsky avatar Jul 21 '22 16:07 davidbarsky

I'm not likely to get back to this unfortunately, so closing out.

kmahar avatar Mar 02 '23 17:03 kmahar