Skip to content

Commit e004386

Browse files
committed
Use error! instead of println! when panicking
1 parent 0b13333 commit e004386

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

os/src/lang_items.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
33
use crate::sbi::shutdown;
44
use core::panic::PanicInfo;
5+
use log::*;
56

67
#[panic_handler]
78
fn panic(info: &PanicInfo) -> ! {
89
if let Some(location) = info.location() {
9-
println!(
10+
error!(
1011
"[kernel] Panicked at {}:{} {}",
1112
location.file(),
1213
location.line(),
1314
info.message().unwrap()
1415
);
1516
} else {
16-
println!("[kernel] Panicked: {}", info.message().unwrap());
17+
error!("[kernel] Panicked: {}", info.message().unwrap());
1718
}
1819
shutdown(true)
1920
}

0 commit comments

Comments
 (0)