Skip to content

Commit 756495f

Browse files
authored
fix: use env filter properly (#132)
* fix: use env filter properly Apparently if we pass env filter in an array with the other layers it won't be executed first (to act as a filter). This change fixes that by explicitly adding it before. * chore: bump version
1 parent 38c45bb commit 756495f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-agent"
3-
version = "2.10.0"
3+
version = "2.10.1"
44
edition = "2021"
55

66
[[bin]]

src/bin/agent.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ async fn main() -> Result<()> {
5858
.with_ansi(std::io::stderr().is_terminal());
5959

6060
let mut layers = Vec::new();
61-
layers.push(env_filter.boxed());
6261

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

94-
tracing_subscriber::registry().with(layers).init();
93+
tracing_subscriber::registry()
94+
.with(env_filter)
95+
.with(layers)
96+
.init();
9597

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

0 commit comments

Comments
 (0)