Send logging messages even if the channel lock is poisoned.

This commit is contained in:
Alan Jeffrey 2016-07-28 15:49:52 -05:00
parent 82f734b9a3
commit 3646ddd7f2

View file

@ -342,12 +342,11 @@ impl Log for FromScriptLogger {
let pipeline_id = PipelineId::installed();
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromScriptMsg::LogEntry(pipeline_id, thread_name, entry);
if let Ok(chan) = self.constellation_chan.lock() {
let chan = self.constellation_chan.lock().unwrap_or_else(|err| err.into_inner());
let _ = chan.send(msg);
}
}
}
}
/// A logger directed at the constellation from the compositor
#[derive(Clone)]
@ -381,12 +380,11 @@ impl Log for FromCompositorLogger {
let pipeline_id = PipelineId::installed();
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromCompositorMsg::LogEntry(pipeline_id, thread_name, entry);
if let Ok(chan) = self.constellation_chan.lock() {
let chan = self.constellation_chan.lock().unwrap_or_else(|err| err.into_inner());
let _ = chan.send(msg);
}
}
}
}
fn log_entry(record: &LogRecord) -> Option<LogEntry> {
match record.level() {