Skip to content

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]>
@@ -1,5 +1,5 @@

use clap::Parser;
#[cfg(feature = "tracing-subscriber")]
Copy link
Contributor

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