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

SubscriberBuilder::with_ansi is incorrectly gated by the ansi feature in tracing-subscriber 0.3.18 #2996

Open
eric-seppanen opened this issue Jun 3, 2024 · 1 comment

Comments

@eric-seppanen
Copy link

Bug Report

Version

tracing v0.1.40
tracing-subscriber v0.3.18

Platform

Linux 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Crates

tracing-subscriber

Description

The tracing-subscriber 0.3.18 docs claim that SubscriberBuilder::with_ansi() can be used even when the ansi feature is disabled. And indeed this is true on master. But in the released 0.3.18 code this is not true: commit 049ad73 did not remove the #[cfg(feature = "ansi")] from the method.

The 0.3.18 version of the code is here:

/// This method itself is still available without the feature flag. This
/// is to allow ANSI escape codes to be explicitly *disabled* without
/// having to opt-in to the dependencies required to emit ANSI formatting.
/// This way, code which constructs a formatter that should never emit
/// ANSI escape codes can ensure that they are not used, regardless of
/// whether or not other crates in the dependency graph enable the "ansi"
/// feature flag.
#[cfg(feature = "ansi")]
#[cfg_attr(docsrs, doc(cfg(feature = "ansi")))]
pub fn with_ansi(self, ansi: bool) -> SubscriberBuilder<N, format::Format<L, T>, F, W> {
SubscriberBuilder {
inner: self.inner.with_ansi(ansi),
..self
}
}

@eric-seppanen eric-seppanen changed the title SubscriberBuilder::with_ansi is incorrectly gated by the ansi feature in 0.3.18 SubscriberBuilder::with_ansi is incorrectly gated by the ansi feature in tracing-subscriber 0.3.18 Jun 3, 2024
@eric-seppanen
Copy link
Author

eric-seppanen commented Jun 3, 2024

The commit on master is slightly different: 1cb523b

Looks like it was broken during the backport in #2570.

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

No branches or pull requests

1 participant