This repository was archived by the owner on May 12, 2026. It is now read-only.
Enable making tracing-subscriber an optional dependency#18
Open
kate-goldenring wants to merge 1 commit into
Open
Enable making tracing-subscriber an optional dependency#18kate-goldenring wants to merge 1 commit into
kate-goldenring wants to merge 1 commit into
Conversation
The tracing-subscriber crate enables the tracing-log feature which will set up a global logger and panic if one already exists. If this project is consumed as a library a subscriber and logger may already exist and should not be reinitialized. Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
radu-matei
approved these changes
Mar 29, 2024
| @@ -1,5 +1,5 @@ | |||
|
|
|||
| use clap::Parser; | |||
| #[cfg(feature = "tracing-subscriber")] | |||
Contributor
There was a problem hiding this comment.
Alternatively you can probably remove this dependency and use std::io::IsTerminal
calebschoepp
approved these changes
Apr 1, 2024
Contributor
calebschoepp
left a comment
There was a problem hiding this comment.
LGTM as well. Let's hold off on merging this though. It turns out we may still need to switch from logging to tracing in runwasi which would make this obsolete.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The
tracing-subscribercrate enables thetracing-logfeature which will set up a global logger and panic if one already exists. If this project is consumed as a library a subscriber and logger may already exist and should not be reinitialized.Where the
tracing-logfeature enables recreating a global logger: https://github.com/tokio-rs/tracing/blob/908cc432a5994f6e17c8f36e13c217dc40085704/tracing-subscriber/src/util.rs#L65