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
I'm currently using reload::Layer with a Filtered layer to activate different tracing levels for various modules dynamically. However, it's not currently possible to modify the currently span event configuration since with_span_events can only be set when creating the layer. Due to #1629 , I'm not able to completely reload the layer.
The fmt::Layer has a few methods to mutably change aspects of the layer, namely writer_mut and set_ansi.
It seems like adding a set_span_events method in a similar vein to set_ansi would make sense?
The downside to this approach is that a span configuration could be changed mid-span, causing a CLOSE for an already entered span to not be emitted. I think this is acceptable, however, due to the reload layer already having the flexibility to change the underlying layer/writer/filter, but this will just need to be clear in docs.
I'm happy to implement this if the API makes sense! :)
Alternative ways to approach this would be to fix #1629. The workarounds present in that issue are not applicable to my use-case as it removes the abilities for other layers to do filtering.
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tracing-subscriber
Motivation
I'm currently using
reload::Layer
with aFiltered
layer to activate different tracing levels for various modules dynamically. However, it's not currently possible to modify the currently span event configuration sincewith_span_events
can only be set when creating the layer. Due to #1629 , I'm not able to completely reload the layer.The
fmt::Layer
has a few methods to mutably change aspects of the layer, namelywriter_mut
andset_ansi
.It seems like adding a
set_span_events
method in a similar vein toset_ansi
would make sense?The downside to this approach is that a span configuration could be changed mid-span, causing a
CLOSE
for an already entered span to not be emitted. I think this is acceptable, however, due to the reload layer already having the flexibility to change the underlying layer/writer/filter, but this will just need to be clear in docs.I'm happy to implement this if the API makes sense! :)
Proposal
Add a new
set_span_events
method totracing_subscriber::fmt::Layer
Alternatives
Alternative ways to approach this would be to fix #1629. The workarounds present in that issue are not applicable to my use-case as it removes the abilities for other layers to do filtering.
The text was updated successfully, but these errors were encountered: