fix: Hide warn-level logs in the zebra-consensus tests
Unless RUST_LOG is set.
This commit is contained in:
parent
a60299d86c
commit
12cbe410f2
|
|
@ -10,10 +10,14 @@ static INIT: Once = Once::new();
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
let fmt_layer = fmt::layer().with_target(false);
|
let fmt_layer = fmt::layer().with_target(false);
|
||||||
// Use the RUST_LOG env var, or 'warn' by default
|
// Use the RUST_LOG env var, or by default:
|
||||||
let filter_layer = EnvFilter::try_from_default_env()
|
// - warn for most tests, and
|
||||||
.or_else(|_| EnvFilter::try_new("warn"))
|
// - for some modules, hide expected warn logs
|
||||||
.unwrap();
|
let filter_layer = EnvFilter::try_from_default_env().unwrap_or_else(|_| {
|
||||||
|
EnvFilter::try_new("warn")
|
||||||
|
.unwrap()
|
||||||
|
.add_directive("zebra_consensus=error".parse().unwrap())
|
||||||
|
});
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
.with(filter_layer)
|
.with(filter_layer)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue