Auto merge of #12468 - asajeffrey:constellation-remove-panic-channel, r=emilio

Removed panic channel, replaced by integrated logging and issue reporting

<!-- Please describe your changes on the following line: -->

Remove the previous ad hoc panic channel, replace it by an integrated logging and panicking mechanism, including crash reporting. All thread panics are now reported, not just content threads.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11838
- [X] These changes do not require tests because we don't test error reporting

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12468)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-21 11:20:37 -05:00 committed by GitHub
commit df1b00d43d
22 changed files with 85 additions and 251 deletions

View file

@ -2409,7 +2409,6 @@ name = "util"
version = "0.0.1"
dependencies = [
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -26,7 +26,6 @@ extern crate backtrace;
extern crate glutin_app as app;
#[cfg(target_os = "android")]
extern crate libc;
#[cfg(target_os = "android")]
#[macro_use]
extern crate log;
// The Servo engine
@ -38,8 +37,8 @@ extern crate sig;
use servo::Browser;
use servo::compositing::windowing::WindowEvent;
use servo::util::opts::{self, ArgumentParsingResult};
use servo::util::panicking::initiate_panic_hook;
use servo::util::servo_version;
use std::panic;
use std::process;
use std::rc::Rc;
@ -94,7 +93,20 @@ fn main() {
None
};
initiate_panic_hook();
// TODO: once log-panics is released, this can be replaced by
// log_panics::init();
panic::set_hook(Box::new(|info| {
warn!("Panic hook called.");
let msg = match info.payload().downcast_ref::<&'static str>() {
Some(s) => *s,
None => match info.payload().downcast_ref::<String>() {
Some(s) => &**s,
None => "Box<Any>",
},
};
error!("{}", msg);
}));
setup_logging();
if let Some(token) = content_process_token {