|
|
|
@ -30,8 +30,8 @@ macro_rules! print {
|
|
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
|
macro_rules! println {
|
|
|
|
|
($fmt:expr) => (print!(concat!($fmt, "\r\n")));
|
|
|
|
|
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\r\n"), $($arg)*));
|
|
|
|
|
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
|
|
|
|
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Add escape sequence to print with color in Linux console
|
|
|
|
@ -67,7 +67,7 @@ impl Log for SimpleLogger {
|
|
|
|
|
if self.enabled(record.metadata()) && !DISABLED_TARGET.contains(&record.target()) {
|
|
|
|
|
// let target = record.target();
|
|
|
|
|
// let begin = target.as_bytes().iter().rposition(|&c| c == b':').map(|i| i + 1).unwrap_or(0);
|
|
|
|
|
print_in_color(format_args!("[{:>5}] {}\r\n", record.level(), record.args()), Color::from(record.level()));
|
|
|
|
|
print_in_color(format_args!("[{:>5}] {}\n", record.level(), record.args()), Color::from(record.level()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fn flush(&self) {}
|
|
|
|
|