From 68818929abdd4bc8b4bd1f85028159bc7d1aec67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= <bkchr@users.noreply.github.com> Date: Sun, 24 Nov 2019 11:28:29 +0100 Subject: [PATCH] Log runtime `panic` and `oom` with level error (#4193) --- substrate/primitives/sr-io/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/substrate/primitives/sr-io/src/lib.rs b/substrate/primitives/sr-io/src/lib.rs index 2b40670c450..4ceabb4511a 100644 --- a/substrate/primitives/sr-io/src/lib.rs +++ b/substrate/primitives/sr-io/src/lib.rs @@ -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(); } } -- GitLab