Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use env filter properly #132

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyth-agent"
version = "2.10.0"
version = "2.10.1"
edition = "2021"

[[bin]]
Expand Down
6 changes: 4 additions & 2 deletions src/bin/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ async fn main() -> Result<()> {
.with_ansi(std::io::stderr().is_terminal());

let mut layers = Vec::new();
layers.push(env_filter.boxed());

// Set up OpenTelemetry only if it's configured
if let Some(opentelemetry_config) = &config.opentelemetry {
Expand Down Expand Up @@ -91,7 +90,10 @@ async fn main() -> Result<()> {
layers.push(fmt_layer.json().boxed());
}

tracing_subscriber::registry().with(layers).init();
tracing_subscriber::registry()
.with(env_filter)
.with(layers)
.init();

// Launch the application. If it fails, print the full backtrace and exit. RUST_BACKTRACE
// should be set to 1 for this otherwise it will only print the top-level error.
Expand Down
Loading