panic_hook module uses eprintln instead of raw stderr interface (#10426)

This commit is contained in:
Marek Kotewicz 2019-02-27 10:48:40 +01:00 committed by Andrew Jones
parent cfc8df156b
commit 3d0ce10fa6

View File

@ -18,7 +18,6 @@
extern crate backtrace; extern crate backtrace;
use std::io::{self, Write};
use std::panic::{self, PanicInfo}; use std::panic::{self, PanicInfo};
use std::thread; use std::thread;
use std::process; use std::process;
@ -27,7 +26,7 @@ use backtrace::Backtrace;
/// Set the panic hook to write to stderr and abort the process when a panic happens. /// Set the panic hook to write to stderr and abort the process when a panic happens.
pub fn set_abort() { pub fn set_abort() {
set_with(|msg| { set_with(|msg| {
let _ = io::stderr().write_all(msg.as_bytes()); eprintln!("{}", msg);
process::abort() process::abort()
}); });
} }