• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Compare to the example given in the documentation for the `std::dbg` macro.
2 #![deny(rust_2018_idioms)]
3 
4 use tracing_macros::dbg;
5 
factorial(n: u32) -> u326 fn factorial(n: u32) -> u32 {
7     if dbg!(n <= 1) {
8         dbg!(1)
9     } else {
10         dbg!(n * factorial(n - 1))
11     }
12 }
13 
main()14 fn main() {
15     env_logger::Builder::new().parse_filters("trace").init();
16     #[allow(deprecated)]
17     let subscriber = tracing_log::TraceLogger::new();
18 
19     tracing::subscriber::with_default(subscriber, || dbg!(factorial(4)));
20 }
21