Skip to content

Commit

Permalink
Add force_flush exporter call to SimpleLogProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan committed Nov 18, 2024
1 parent 6974ced commit 9290828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion opentelemetry-sdk/src/logs/log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ impl LogProcessor for SimpleLogProcessor {
}

fn force_flush(&self) -> LogResult<()> {
Ok(())
if let Ok(mut exporter) = self.exporter.lock() {
exporter.force_flush()
} else {
Err(LogError::MutexPoisoned("SimpleLogProcessor".into()))

Check warning on line 135 in opentelemetry-sdk/src/logs/log_processor.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/logs/log_processor.rs#L135

Added line #L135 was not covered by tests
}
}

fn shutdown(&self) -> LogResult<()> {
Expand Down

0 comments on commit 9290828

Please sign in to comment.