So far, we use eprintln! to handle some fallible flush in place. We should change the signature of Append::flush and handle all the error in:
impl log::Log for Logger {
fn enabled(&self, metadata: &Metadata) -> bool {
self.dispatches
.iter()
.any(|dispatch| dispatch.enabled(metadata))
}
fn log(&self, record: &Record) {
for dispatch in &self.dispatches {
if let Err(err) = dispatch.log(record) {
handle_error(record, err);
}
}
}
fn flush(&self) {
for dispatch in &self.dispatches {
dispatch.flush(); <- use a similar pattern to `log`
}
}
}
Maybe add an ErrorSink trait for customizing error handling logics also.
So far, we use
eprintln!to handle some fallible flush in place. We should change the signature ofAppend::flushand handle all the error in:Maybe add an
ErrorSinktrait for customizing error handling logics also.