Hacker News new | ask | show | jobs
by eknkc 683 days ago
I was trying out the stdout example. Could not get it to log anything. DuckDB example worked so I went digging into the source. Apparently the stdout sink is using tracing and I did not have a `RUST_LOG` env var set.

Might be a good idea to have it documented or have the default level set to info for the stdout example.

Maybe this is common Rust knowledge and I just don't know what I'm doing though.

1 comments

I too consider this a footgun.

Most applications will have something like

   tracing_subscriber::registry()
           .with(
               tracing_subscriber::EnvFilter::try_from_default_env()
                   .unwrap_or_else(|_| "my_app=info".into()),
           )
           .with(tracing_subscriber::fmt::layer())
           .init();

in the `main.rs` which will default the tracing if RUST_LOG env var is not set.
Thanks for trying out, I'll update the code and/or the README to fix this.