~nickbp/kapiti

1f8b4daf0270a43e8eedd5faf8f8b3eb1d91a784 — Nick Parker 5 months ago 5dd7b39
Write logs to stderr
1 files changed, 5 insertions(+), 5 deletions(-)

M src/logging.rs
M src/logging.rs => src/logging.rs +5 -5
@@ 1,6 1,5 @@
use tracing;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::{fmt, EnvFilter};
use tracing_subscriber::EnvFilter;

pub fn init_logging() {
    let filter_layer = EnvFilter::try_from_env("LOG_LEVEL")


@@ 8,9 7,10 @@ pub fn init_logging() {
        .expect("Failed to initialize filter layer");

    tracing::subscriber::set_global_default(
        tracing_subscriber::Registry::default()
            .with(filter_layer)
            .with(fmt::layer()),
        tracing_subscriber::fmt()
            .with_writer(std::io::stderr)
            .with_env_filter(filter_layer)
            .finish()
    )
    .expect("Failed to set default subscriber");
}