Skip to content

Commit

Permalink
Short circuit the event_enabled check (#2533)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Jan 22, 2025
1 parent acaa98d commit b1debf0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions opentelemetry-sdk/src/logs/log_emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,10 @@ impl opentelemetry::logs::Logger for Logger {

#[cfg(feature = "spec_unstable_logs_enabled")]
fn event_enabled(&self, level: Severity, target: &str) -> bool {
let provider = &self.provider;

let mut enabled = false;
for processor in provider.log_processors() {
enabled = enabled || processor.event_enabled(level, target, self.scope.name().as_ref());
}
enabled
self.provider
.log_processors()
.iter()
.any(|processor| processor.event_enabled(level, target, self.scope.name().as_ref()))
}
}

Expand Down

0 comments on commit b1debf0

Please sign in to comment.