mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Send logging messages even if the channel lock is poisoned.
This commit is contained in:
parent
82f734b9a3
commit
3646ddd7f2
1 changed files with 4 additions and 6 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue