From 3c9228e60dff93103bfd99f4fe0d3e70d4251837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20M=C3=A4rkle?= Date: Tue, 28 Jan 2025 09:57:26 +0100 Subject: [PATCH] LEA -> Filter TRACE logs from other crates. --- opendut-lea/Cargo.toml | 2 +- opendut-lea/src/main.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/opendut-lea/Cargo.toml b/opendut-lea/Cargo.toml index 88c9ccf6..4ea40e66 100644 --- a/opendut-lea/Cargo.toml +++ b/opendut-lea/Cargo.toml @@ -26,7 +26,7 @@ slotmap = { workspace = true } strum = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["ansi"] } +tracing-subscriber = { workspace = true, features = ["ansi", "tracing-log"] } tracing-web = { workspace = true } url = { workspace = true } uuid = { workspace = true } diff --git a/opendut-lea/src/main.rs b/opendut-lea/src/main.rs index d965b313..4136e1e3 100644 --- a/opendut-lea/src/main.rs +++ b/opendut-lea/src/main.rs @@ -3,6 +3,7 @@ use leptos::prelude::*; use tracing::info; use tracing_subscriber::fmt::format::Pretty; +use tracing_subscriber::{filter, Layer}; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; @@ -31,7 +32,13 @@ fn main() { .with_ansi(false) .without_time() .with_writer(tracing_web::MakeConsoleWriter) - .pretty(); + .pretty() + .with_filter( + filter::Targets::default() + .with_default(tracing::Level::DEBUG) + .with_target("opendut", tracing::Level::TRACE) + ); + let perf_layer = tracing_web::performance_layer() .with_details_from_fields(Pretty::default());