parse configured EnvFilter once

This allows the error handling to be done upfront instead of for each
use. In particular, the `toml` error now points to the span of text in
the config file where the misconfigured EnvFilter value is. This is much
better than the previous error that did not indicate what was actually
causing it to happen.
This commit is contained in:
Charles Hall 2024-06-07 13:11:46 -07:00
parent 6b819d6f2d
commit c46eaed0e0
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 54 additions and 11 deletions

View file

@ -61,9 +61,6 @@ pub(crate) enum Observability {
#[error("opentelemetry error")]
Otel(#[from] opentelemetry::trace::TraceError),
#[error("invalid log filter syntax")]
EnvFilter(#[from] tracing_subscriber::filter::ParseError),
#[error("failed to install global default tracing subscriber")]
SetSubscriber(#[from] tracing::subscriber::SetGlobalDefaultError),