diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-21 11:20:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-21 11:20:37 -0500 |
commit | df1b00d43db615244e8e4bcf8296ed51b64249ea (patch) | |
tree | 41ef9ab638ea67979e19ee6914f4f3f206b3f184 /components/servo/main.rs | |
parent | 07a0c2f1dc87fc21a4ed96d251390a4bff165bda (diff) | |
parent | c889900cff2cde40d21fa27810b9c4b0b57c390a (diff) | |
download | servo-df1b00d43db615244e8e4bcf8296ed51b64249ea.tar.gz servo-df1b00d43db615244e8e4bcf8296ed51b64249ea.zip |
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 -->
Diffstat (limited to 'components/servo/main.rs')
-rw-r--r-- | components/servo/main.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/components/servo/main.rs b/components/servo/main.rs index 954c3f0e848..a13c2ca8b5d 100644 --- a/components/servo/main.rs +++ b/components/servo/main.rs @@ -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 { |