Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscriber: add set_span_events to fmt::Subscriber #2962

Merged
merged 3 commits into from May 25, 2024

Conversation

lpraneis
Copy link
Contributor

@lpraneis lpraneis commented May 3, 2024

Motivation

Using reload::Layer with a Filtered layer makes it possible 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 it's not possible to completely re-load a layer and so span config is essentially set-once.

Solution

This PR adds a method similar to set_ansi to allow modifying the fmt span configuration in a call to reload::Handle::modify

Closes #2957

@lpraneis lpraneis requested review from hawkw, davidbarsky and a team as code owners May 3, 2024 18:59
@davidbarsky davidbarsky enabled auto-merge (squash) May 25, 2024 17:41
@davidbarsky davidbarsky merged commit e7aeee8 into tokio-rs:master May 25, 2024
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to dynamically set the span event configuration in a fmt::Layer
3 participants