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

Enable making tracing-subscriber an optional dependency #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kate-goldenring
Copy link
Contributor

@kate-goldenring kate-goldenring commented Mar 28, 2024

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.

Where the tracing-log feature enables recreating a global logger: https://github.com/tokio-rs/tracing/blob/908cc432a5994f6e17c8f36e13c217dc40085704/tracing-subscriber/src/util.rs#L65

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 <[email protected]>
use clap::Parser;
#[cfg(feature = "tracing-subscriber")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively you can probably remove this dependency and use std::io::IsTerminal

Copy link
Contributor

@calebschoepp calebschoepp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

4 participants