mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: logger: show caller
This commit is contained in:
parent
c3d59bc9a4
commit
284e12348d
@ -9,7 +9,7 @@ use crate::plat::timer::{Timer, TimerOps};
|
||||
use crate::plat::trap::{Trap, TrapOps};
|
||||
|
||||
#[thread_local]
|
||||
static HART_ID: Cell<usize> = Cell::new(0);
|
||||
pub static HART_ID: Cell<usize> = Cell::new(0);
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_main(hart_id: usize, device_tree_addr: usize) -> ! {
|
||||
|
@ -31,11 +31,13 @@ impl Log for SimpleLogger {
|
||||
|
||||
RawConsole
|
||||
.write_fmt(format_args!(
|
||||
"{}[{}] {}{}\n",
|
||||
color_prefix,
|
||||
"{color_prefix}[{}] [{}] {}{color_reset}\n",
|
||||
record.level(),
|
||||
record
|
||||
.module_path_static()
|
||||
.or_else(|| record.module_path())
|
||||
.unwrap_or("<n/a>"),
|
||||
record.args(),
|
||||
color_reset
|
||||
))
|
||||
.unwrap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user