More docs

This commit is contained in:
Tony Garnock-Jones 2021-08-13 21:28:23 -04:00
parent fe9c0325eb
commit 085fd6735b
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ impl<M: Debug> Entity<M> for Tracer {
}
}
/// Sets up [`tracing`] logging in a reasonable way.
///
/// Useful at the top of `main` functions.
pub fn convenient_logging() -> Result<(), Box<dyn std::error::Error>> {
let filter = match std::env::var(tracing_subscriber::filter::EnvFilter::DEFAULT_ENV) {
Err(std::env::VarError::NotPresent) =>