Added register dump to panic() and colors to printk()

This commit is contained in:
2026-03-29 20:39:06 +02:00
parent 12ec371196
commit 22852599df
10 changed files with 66 additions and 34 deletions
+15 -1
View File
@@ -22,7 +22,21 @@ int vprintk(const char* fmt, va_list ap) {
if (loglevel > console_loglevel) return 0;
// Loglevel colors
switch (loglevel) {
case LOGLEVEL_EMERG: debugf("\x1b[1;31m"); break; // bold red
case LOGLEVEL_ALERT: debugf("\x1b[1;31m"); break; // bold red
case LOGLEVEL_CRIT: debugf("\x1b[31m"); break; // red
case LOGLEVEL_ERROR: debugf("\x1b[31m"); break; // red
case LOGLEVEL_WARNING: debugf("\x1b[33m"); break; // yellow
case LOGLEVEL_NOTICE: debugf("\x1b[34m"); break; // green
case LOGLEVEL_INFO: debugf("\x1b[37m"); break; // white
case LOGLEVEL_DEBUG: debugf("\x1b[2;32m"); break; // green
}
// TODO: debugf("[%4d.%6d] ", seconds, milliseconds);
return vdebugf(fmt, ap);
int ret = vdebugf(fmt, ap);
debugf("\x1b[0m");
return ret;
}