forked from AbleOS/ableos
Merge
This commit is contained in:
commit
387d3f2bae
|
@ -1,14 +1,22 @@
|
|||
pub trait Log {
|
||||
<<<<<<< HEAD
|
||||
fn debug(val: &str);
|
||||
fn error(val: &str);
|
||||
fn info(val: &str);
|
||||
fn trace(val: &str);
|
||||
=======
|
||||
fn debug(val: &str);
|
||||
fn error();
|
||||
fn info(val: &str);
|
||||
fn trace();
|
||||
>>>>>>> 6a61fb8a9ede4d1a04da38100c4f7728e721b2d4
|
||||
}
|
||||
|
||||
use crate::serial_print;
|
||||
use lliw::{Fg, Reset};
|
||||
pub struct ANSISerialLogger;
|
||||
impl Log for ANSISerialLogger {
|
||||
<<<<<<< HEAD
|
||||
fn debug(val: &str) {
|
||||
serial_print!("[{}Debug{}] {}\n", Fg::Blue, Reset, val);
|
||||
}
|
||||
|
@ -21,4 +29,46 @@ impl Log for ANSISerialLogger {
|
|||
fn trace(val: &str) {
|
||||
serial_print!("[{}Trace{}] {}\n", Fg::Yellow, Reset, val);
|
||||
}
|
||||
=======
|
||||
fn debug(val: &str) {
|
||||
serial_print!("[{}Debug{}] {}\n", Fg::Blue, Reset, val);
|
||||
}
|
||||
fn error() {
|
||||
todo!();
|
||||
}
|
||||
fn info(val: &str) {
|
||||
serial_print!("[{}Info{}] {}\n", Fg::Blue, Reset, val);
|
||||
}
|
||||
fn trace() {
|
||||
todo!();
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($($arg:tt)*) => ({
|
||||
log::ANSISerialLogger::debug(&format!($($arg)*));
|
||||
})
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! error {
|
||||
($($arg:tt)*) => ({
|
||||
log::ANSISerialLogger::error(&format!($($arg)*));
|
||||
})
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! info {
|
||||
($($arg:tt)*) => ({
|
||||
log::ANSISerialLogger::info(&format!($($arg)*));
|
||||
})
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! trace {
|
||||
($($arg:tt)*) => ({
|
||||
log::ANSISerialLogger::trace(&format!($($arg)*));
|
||||
})
|
||||
>>>>>>> 6a61fb8a9ede4d1a04da38100c4f7728e721b2d4
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue