diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2016-07-11 14:09:54 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2016-07-20 21:56:43 -0500 |
commit | c889900cff2cde40d21fa27810b9c4b0b57c390a (patch) | |
tree | 5b2988473f32ebefa4af1c73f4e417fb99a51c0f /components/servo/main.rs | |
parent | b34b30fd96e29f9c3773c9146c78e3d47fdc156d (diff) | |
download | servo-c889900cff2cde40d21fa27810b9c4b0b57c390a.tar.gz servo-c889900cff2cde40d21fa27810b9c4b0b57c390a.zip |
Removed panic channel, replaced by integrated logging and issue reporting.
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 { |