aboutsummaryrefslogtreecommitdiff
path: root/src/output/pipeline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/pipeline.rs')
-rw-r--r--src/output/pipeline.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/output/pipeline.rs b/src/output/pipeline.rs
index 9b7f461..3db0d56 100644
--- a/src/output/pipeline.rs
+++ b/src/output/pipeline.rs
@@ -3,6 +3,8 @@ use super::{aggregators::Aggregator, formats::Format};
use std::{io::Write, sync::Mutex};
+use anyhow::Result;
+
pub struct Pipeline {
format: Box<dyn Format>,
aggregator: Box<dyn Aggregator>,
@@ -22,13 +24,13 @@ impl Pipeline {
}
}
- pub fn push_item(&self, item: LogResult) {
+ pub fn push_item(&self, item: LogResult) -> Result<()> {
let mut writer = self.writer.lock().unwrap();
- self.aggregator.push_item(item, &*self.format, &mut *writer);
+ self.aggregator.push_item(item, &*self.format, &mut *writer)
}
- pub fn finish(self) {
+ pub fn finish(self) -> Result<()> {
let mut writer = self.writer.lock().unwrap();
- self.aggregator.finish(&*self.format, &mut *writer);
+ self.aggregator.finish(&*self.format, &mut *writer)
}
}