feat(Terminal): Add colored log level representation in KernelLogStream

This commit is contained in:
2025-12-06 18:12:02 +01:00
parent 8721194aeb
commit ee0b8395a2
2 changed files with 21 additions and 4 deletions
+19 -2
View File
@@ -111,10 +111,27 @@ namespace Kt
const char* componentName = ""; const char* componentName = "";
public: public:
KernelLogStream(KernelLogLevel, const char* desiredComponentName) { /* level for potential future rich event logging */ const char* LogLevelToStringWithColor(KernelLogLevel level) {
switch (level) {
case INFO:
return "\e[0;36mINFO\e[0m"; // Cyan
case WARNING:
return "\e[0;33mWARNING\e[0m"; // Yellow
case ERROR:
return "\e[0;31mERROR\e[0m"; // Red
case DEBUG:
return "\e[0;35mDEBUG\e[0m"; // Magenta
case OK:
return "\e[0;32mOK\e[0m"; // Green
default:
return "UNKNOWN";
}
}
KernelLogStream(KernelLogLevel level, const char* desiredComponentName) { /* level for potential future rich event logging */
componentName = desiredComponentName; componentName = desiredComponentName;
localStream << componentName << ": "; localStream << componentName << ": " << "[" << LogLevelToStringWithColor(level) << "] ";
} }
~KernelLogStream() { ~KernelLogStream() {
+2 -2
View File
@@ -1,8 +1,8 @@
# Timeout in seconds that Limine will use before automatically booting. # Timeout in seconds that Limine will use before automatically booting.
timeout: 3 timeout: 0
# The entry name that will be displayed in the boot menu. # The entry name that will be displayed in the boot menu.
/Limine Template /zenithos
# We use the Limine boot protocol. # We use the Limine boot protocol.
protocol: limine protocol: limine