David Barsky 1c802c7763
log: remove deprecated env_logger and trace_logger APIs (#2771)
Removing the `env_logger` feature in order to address GHSA-g98v-hv3f-hcfr.

In addition, this PR also removes the deprecated `trace_logger` module, in
preparation for an upcoming v0.2.0 of `tracing-log`.

For additional details on the approach, please refer to #2750. Note that this
PR depends on #2770, so this PR will temporarily have more commits 
than intended. 
---------

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2023-10-24 17:09:21 +00:00

23 lines
638 B
Rust

//! Compare to the example given in the documentation for the `std::dbg` macro.
#![deny(rust_2018_idioms)]
use tracing_macros::dbg;
use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter};
fn factorial(n: u32) -> u32 {
if dbg!(n <= 1) {
dbg!(1)
} else {
dbg!(n * factorial(n - 1))
}
}
fn main() {
let subscriber = tracing_subscriber::registry()
.with(EnvFilter::from_default_env().add_directive(tracing::Level::TRACE.into()))
.with(fmt::Layer::new());
tracing::subscriber::set_global_default(subscriber).expect("Unable to set a global subscriber");
dbg!(factorial(4));
}