mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: format console/log
This commit is contained in:
parent
0c14eaa057
commit
cd6b773326
@ -44,8 +44,7 @@ impl Log for SimpleLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
static LOGGER: SimpleLogger = SimpleLogger;
|
log::set_logger(&SimpleLogger).unwrap();
|
||||||
log::set_logger(&LOGGER).unwrap();
|
|
||||||
|
|
||||||
// TODO: get log level from boot env
|
// TODO: get log level from boot env
|
||||||
log::set_max_level(LevelFilter::Trace);
|
log::set_max_level(LevelFilter::Trace);
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
pub struct RawConsole
|
pub struct RawConsole
|
||||||
where RawConsole: Printer;
|
where RawConsole: Printer + Reader;
|
||||||
|
|
||||||
pub trait Printer: core::fmt::Write {
|
pub trait Printer: core::fmt::Write {
|
||||||
fn put_char(c: char);
|
fn put_char(c: char);
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn put_str(s: &str) {
|
fn put_str(s: &str) {
|
||||||
s.chars().for_each(Self::put_char);
|
s.chars().for_each(Self::put_char);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn put_line(s: &str) {
|
fn put_line(s: &str) {
|
||||||
Self::put_str(s);
|
Self::put_str(s);
|
||||||
Self::put_char('\n');
|
Self::put_char('\n');
|
||||||
|
Loading…
Reference in New Issue
Block a user