Skip to content

Commit

Permalink
subscriber: remove fmt layer from init (console-rs#64)
Browse files Browse the repository at this point in the history
With the `fmt` layer being added by default, plus this layer filtering
for `RUST_LOG=tokio=trace`, it can be rather noisy. I think we can
remove the fmt layer from the default.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
seanmonstar and hawkw authored Aug 13, 2021
1 parent bdf66b5 commit 778a8f1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions console-subscriber/src/init.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::TasksLayer;
use std::thread;
use tokio::runtime;
use tracing_subscriber::{fmt, layer::Layered, prelude::*, EnvFilter, Registry};
use tracing_subscriber::{layer::Layered, prelude::*, EnvFilter, Registry};

type ConsoleSubscriberLayer = Layered<TasksLayer, Layered<EnvFilter, Registry>>;

Expand Down Expand Up @@ -41,9 +41,8 @@ type ConsoleSubscriberLayer = Layered<TasksLayer, Layered<EnvFilter, Registry>>;
/// // .with(..potential additional layer..)
/// .init();
/// ```
pub fn init() {
build().with(fmt::layer()).init()
build().init()
}

/// Returns a new `tracing` [subscriber] configured with a [`TasksLayer`]
Expand All @@ -62,10 +61,7 @@ pub fn init() {
///
/// ## Differences from `init`
///
/// **Note**: In order to support customizing the format `build` does
/// not attach a [`tracing_subscriber::fmt::layer`], unlike [`init`].
///
/// Additionally, you must call
/// You must call
/// [`init`][tracing_subscriber::util::SubscriberInitExt::init] on the
/// final layer in order to register the subscriber.
///
Expand Down

0 comments on commit 778a8f1

Please sign in to comment.