diff --git a/os/src/lang_items.rs b/os/src/lang_items.rs index 646aef8d..7c449d7c 100644 --- a/os/src/lang_items.rs +++ b/os/src/lang_items.rs @@ -1,17 +1,18 @@ use crate::sbi::shutdown; use core::panic::PanicInfo; +use log::*; #[panic_handler] fn panic(info: &PanicInfo) -> ! { if let Some(location) = info.location() { - println!( + error!( "[kernel] Panicked at {}:{} {}", location.file(), location.line(), info.message().unwrap() ); } else { - println!("[kernel] Panicked: {}", info.message().unwrap()); + error!("[kernel] Panicked: {}", info.message().unwrap()); } shutdown(true) }