mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
servo: Merge #12733 - Print thread name and file location when panicking (from nox:panic-location); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: aced80b56de7921faec73cc1d0fd92c0dd4aa325
This commit is contained in:
parent
dc43a0a68f
commit
6fa7b6fd28
@ -41,6 +41,7 @@ use servo::util::servo_version;
|
||||
use std::panic;
|
||||
use std::process;
|
||||
use std::rc::Rc;
|
||||
use std::thread;
|
||||
|
||||
pub mod platform {
|
||||
#[cfg(target_os = "macos")]
|
||||
@ -107,7 +108,13 @@ fn main() {
|
||||
None => "Box<Any>",
|
||||
},
|
||||
};
|
||||
error!("{}", msg);
|
||||
let current_thread = thread::current();
|
||||
let name = current_thread.name().unwrap_or("<unnamed>");
|
||||
if let Some(location) = info.location() {
|
||||
error!("{} (thread {}, at {}:{})", msg, name, location.file(), location.line());
|
||||
} else {
|
||||
error!("{} (thread {})", msg, name);
|
||||
}
|
||||
}));
|
||||
|
||||
setup_logging();
|
||||
|
Loading…
Reference in New Issue
Block a user