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};
|
use crate::plat::trap::{Trap, TrapOps};
|
||||||
|
|
||||||
#[thread_local]
|
#[thread_local]
|
||||||
static HART_ID: Cell<usize> = Cell::new(0);
|
pub static HART_ID: Cell<usize> = Cell::new(0);
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn rust_main(hart_id: usize, device_tree_addr: usize) -> ! {
|
pub extern "C" fn rust_main(hart_id: usize, device_tree_addr: usize) -> ! {
|
||||||
|
@ -31,11 +31,13 @@ impl Log for SimpleLogger {
|
|||||||
|
|
||||||
RawConsole
|
RawConsole
|
||||||
.write_fmt(format_args!(
|
.write_fmt(format_args!(
|
||||||
"{}[{}] {}{}\n",
|
"{color_prefix}[{}] [{}] {}{color_reset}\n",
|
||||||
color_prefix,
|
|
||||||
record.level(),
|
record.level(),
|
||||||
|
record
|
||||||
|
.module_path_static()
|
||||||
|
.or_else(|| record.module_path())
|
||||||
|
.unwrap_or("<n/a>"),
|
||||||
record.args(),
|
record.args(),
|
||||||
color_reset
|
|
||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user