tracing output
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
use tokio::task::JoinHandle;
|
||||
use tracing_bunyan_formatter::{BunyanFormattingLayer, JsonStorageLayer};
|
||||
use tracing_subscriber::{fmt::MakeWriter, layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
pub fn init_subscriber<Sink>(sink: Sink)
|
||||
where
|
||||
Sink: for<'a> MakeWriter<'a> + Send + Sync + 'static,
|
||||
{
|
||||
let formatting_layer = BunyanFormattingLayer::new(env!("CARGO_CRATE_NAME").into(), sink);
|
||||
tracing_subscriber::registry()
|
||||
.with(
|
||||
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| {
|
||||
@@ -17,8 +15,7 @@ where
|
||||
.into()
|
||||
}),
|
||||
)
|
||||
.with(JsonStorageLayer)
|
||||
.with(formatting_layer)
|
||||
.with(tracing_subscriber::fmt::layer().pretty().with_writer(sink))
|
||||
.init();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user