Log runtime panic and oom with level error (#4193)

This commit is contained in:
Bastian Köcher
2019-11-24 11:28:29 +01:00
committed by GitHub
parent f0fc2d89d2
commit 68818929ab
+2 -4
View File
@@ -743,7 +743,7 @@ mod allocator_impl {
pub fn panic(info: &core::panic::PanicInfo) -> ! {
unsafe {
let message = rstd::alloc::format!("{}", info);
misc::print_utf8(message.as_bytes());
logging::log(LogLevel::Error, "runtime", message.as_bytes());
core::intrinsics::abort()
}
}
@@ -751,10 +751,8 @@ pub fn panic(info: &core::panic::PanicInfo) -> ! {
#[cfg(all(not(feature = "disable_oom"), not(feature = "std")))]
#[alloc_error_handler]
pub extern fn oom(_: core::alloc::Layout) -> ! {
static OOM_MSG: &str = "Runtime memory exhausted. Aborting";
unsafe {
misc::print_utf8(OOM_MSG.as_bytes());
logging::log(LogLevel::Error, "runtime", b"Runtime memory exhausted. Aborting");
core::intrinsics::abort();
}
}