More professional dmesg

This commit is contained in:
Adrien Bourmault 2020-02-11 18:06:42 +01:00
parent 9930a45163
commit df8ba9e3ea
1 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include <lib/buf.h> #include <lib/buf.h>
#include <kernel.h> #include <kernel.h>
#include <ke/time.h> #include <ke/time.h>
#include <io/vga.h>
// //
// Prints formatted string on standard output // Prints formatted string on standard output
@ -51,7 +52,19 @@ void DebugLog(const char *fmt, ...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
BPrintOnBuf(BStdDbg, "[%d]\t", ticks);
if (ticks) {
BPrintOnBuf(BStdDbg, "[%C%9d%C]\t",
VGA_COLOR_LIGHT_BROWN,
ticks,
VGA_COLOR_LIGHT_GREY);
} else {
BPrintOnBuf(BStdDbg, "[%C%s%C]\t",
VGA_COLOR_GREEN,
" ok",
VGA_COLOR_LIGHT_GREY);
}
BPrintOnBufV(BStdDbg, fmt, ap); BPrintOnBufV(BStdDbg, fmt, ap);
va_end(ap); va_end(ap);
} }