From eeb6974cab7277d5691fee91df8947fe71e05151 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Thu, 22 Oct 2020 17:04:19 -0400 Subject: [PATCH] subscriber: remove deprecated type, structs, and methods #1030 This PR removes the deprecated items in `tracing-subscriber`. It _does not_ remove `Collect::drop_span` as that will happen in a separate PR. Note that branch builds atop of #1015, which means: - #1015 needs to be merged first - This PR will be rebased against the master branch containing #1015. - _Then_ this can safely be merged. --- tracing-subscriber/src/fmt/fmt_subscriber.rs | 47 -------------------- tracing-subscriber/src/fmt/mod.rs | 22 --------- 2 files changed, 69 deletions(-) diff --git a/tracing-subscriber/src/fmt/fmt_subscriber.rs b/tracing-subscriber/src/fmt/fmt_subscriber.rs index 6aa25e2547..27f2dc245b 100644 --- a/tracing-subscriber/src/fmt/fmt_subscriber.rs +++ b/tracing-subscriber/src/fmt/fmt_subscriber.rs @@ -71,34 +71,7 @@ pub struct Subscriber< _inner: PhantomData, } -/// A builder for [`Subscriber`](struct.Subscriber.html) that logs formatted representations of `tracing` -/// events and spans. -/// -/// **Note**: As of `tracing-subscriber` 0.2.4, the separate builder type is now -/// deprecated, as the `Subscriber` type itself supports all the builder's -/// configuration methods. This is now an alias for `Subscriber`. -#[deprecated( - since = "0.2.4", - note = "a separate layer builder type is not necessary, `Subscriber`s now support configuration" -)] -pub type LayerBuilder< - S, - N = format::DefaultFields, - E = format::Format, - W = fn() -> io::Stdout, -> = Subscriber; - impl Subscriber { - /// Returns a new [`LayerBuilder`](type.LayerBuilder.html) for configuring a `Subscriber`. - #[deprecated( - since = "0.2.4", - note = "a separate layer builder is not necessary, use `Subscriber::new`/`Subscriber::default` instead" - )] - #[allow(deprecated)] - pub fn builder() -> LayerBuilder { - Subscriber::default() - } - /// Returns a new [`Subscriber`](struct.Subscriber.html) with the default configuration. pub fn new() -> Self { Self::default() @@ -470,26 +443,6 @@ impl Subscriber { } } -#[allow(deprecated)] -impl LayerBuilder -where - S: Collect + for<'a> LookupSpan<'a>, - N: for<'writer> FormatFields<'writer> + 'static, - E: FormatEvent + 'static, - W: MakeWriter + 'static, -{ - /// Builds a [`Subscriber`] with the provided configuration. - /// - /// [`Subscriber`]: struct.Subscriber.html - #[deprecated( - since = "0.2.4", - note = "`LayerBuilder` is no longer a separate type; this method is not necessary" - )] - pub fn finish(self) -> Subscriber { - self - } -} - impl Default for Subscriber { fn default() -> Self { Subscriber { diff --git a/tracing-subscriber/src/fmt/mod.rs b/tracing-subscriber/src/fmt/mod.rs index ecb948f707..fdba6b93a8 100644 --- a/tracing-subscriber/src/fmt/mod.rs +++ b/tracing-subscriber/src/fmt/mod.rs @@ -128,8 +128,6 @@ mod fmt_subscriber; pub mod format; pub mod time; pub mod writer; -#[allow(deprecated)] -pub use fmt_subscriber::LayerBuilder; pub use fmt_subscriber::{FmtContext, FormattedFields, Subscriber}; use crate::subscribe::Subscribe as _; @@ -850,26 +848,6 @@ impl CollectorBuilder { } } - /// Sets whether or not spans inherit their parents' field values (disabled - /// by default). - #[deprecated(since = "0.2.0", note = "this no longer does anything")] - pub fn inherit_fields(self, inherit_fields: bool) -> Self { - let _ = inherit_fields; - self - } - - /// Sets the function that the collector being built should use to format - /// events that occur. - #[deprecated(since = "0.2.0", note = "renamed to `event_format`.")] - pub fn on_event(self, fmt_event: E2) -> CollectorBuilder - where - E2: FormatEvent + 'static, - N: for<'writer> FormatFields<'writer> + 'static, - W: MakeWriter + 'static, - { - self.event_format(fmt_event) - } - /// Sets the [`MakeWriter`] that the collector being built will use to write events. /// /// # Examples