akern-gkgoat-fork/ableos/src/log.rs

25 lines
483 B
Rust
Raw Normal View History

2021-11-27 09:19:08 -06:00
pub trait Log {
2021-12-24 03:30:27 -06:00
fn debug(val: &str);
2021-11-27 09:19:08 -06:00
fn error();
2021-12-24 03:30:27 -06:00
fn info(val: &str);
2021-11-27 09:19:08 -06:00
fn trace();
}
use crate::serial_print;
use lliw::{Fg, Reset};
2021-11-27 09:19:08 -06:00
pub struct ANSISerialLogger;
impl Log for ANSISerialLogger {
2021-12-24 03:30:27 -06:00
fn debug(val: &str) {
serial_print!("[{}Debug{}] {}\n", Fg::Blue, Reset, val);
2021-11-27 09:19:08 -06:00
}
fn error() {
todo!();
}
2021-12-24 03:30:27 -06:00
fn info(val: &str) {
serial_print!("[{}Info{}] {}\n", Fg::Blue, Reset, val);
2021-11-27 09:19:08 -06:00
}
fn trace() {
todo!();
}
}