rcore-os / rCore-Tutorial-v3

Let's write an OS which can run on RISC-V in Rust from scratch!
https://rcore-os.github.io/rCore-Tutorial-Book-v3/index.html
GNU General Public License v3.0
1.58k stars 452 forks source link

logging模块无法显示日志内容 #142

Closed AnlangA closed 7 months ago

AnlangA commented 7 months ago

在初始化log的时候,需要对日志等级进行设置。

use log::{SetLoggerError, LevelFilter};

static LOGGER: SimpleLogger = SimpleLogger;

pub fn init() -> Result<(), SetLoggerError> {
    log::set_logger(&LOGGER)
        .map(|()| log::set_max_level(LevelFilter::Info))
}
AnlangA commented 7 months ago

是我搞错了