Add support for updating the tracing subscriber in LogPlugin#10822
Merged
alice-i-cecile merged 5 commits intobevyengine:mainfrom Jan 15, 2024
Merged
Add support for updating the tracing subscriber in LogPlugin#10822alice-i-cecile merged 5 commits intobevyengine:mainfrom
alice-i-cecile merged 5 commits intobevyengine:mainfrom
Conversation
Contributor
|
The generated |
james7132
approved these changes
Jan 4, 2024
Member
james7132
left a comment
There was a problem hiding this comment.
LGTM sans the member naming.
|
|
||
| /// Optionally apply extra transformations to the tracing subscriber. | ||
| /// For example add [`Layers`](tracing_subscriber::layer::Layer) | ||
| pub update_subscriber: Option<fn(BoxedSubscriber) -> BoxedSubscriber>, |
Member
There was a problem hiding this comment.
Not the biggest fan of this naming, but this work. Not a strict blocker.
Contributor
Author
There was a problem hiding this comment.
Maybe extend_tracing_subscriber_fn?
Contributor
There was a problem hiding this comment.
Maybe configure/configure_callback
Contributor
There was a problem hiding this comment.
The current name makes sense to me.configure_subscriber maybe?
MiniaczQ
approved these changes
Jan 8, 2024
|
|
||
| /// Optionally apply extra transformations to the tracing subscriber. | ||
| /// For example add [`Layers`](tracing_subscriber::layer::Layer) | ||
| pub update_subscriber: Option<fn(BoxedSubscriber) -> BoxedSubscriber>, |
Contributor
There was a problem hiding this comment.
Maybe configure/configure_callback
NthTensor
approved these changes
Jan 8, 2024
matiqo15
approved these changes
Jan 14, 2024
MiniaczQ
approved these changes
Jan 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
This PR is heavily inspired by #7682
It aims to solve the same problem: allowing the user to extend the tracing subscriber with extra layers.
(in my case, I'd like to use
use metrics_tracing_context::{MetricsLayer, TracingContextLayer};)Solution
I'm proposing a different api where the user has the opportunity to take the existing
subscriberand apply any transformations on it.Changelog
update_subscriberoption on theLogPluginthat lets the user modify thesubscriber(for example to extend it with more tracingLayersMigration Guide
update_subscriberin theLogPlugin