LogManager: Use colors for logging when possible

This commit is contained in:
Tony Wasserka committed 2025-06-13 15:14:47 +02:00
1 parent febce21b21
commit 3e85e60a30
3 files changed
+33 -13

No files matched your search

@@ -6,6 +6,7 @@
#include <cstdarg>
#include <fmt/format.h>
#include <fmt/color.h>
namespace LogMan {
enum DebugLevels {
@@ -31,6 +32,16 @@ static inline const char* DebugLevelStr(uint32_t Level) {
}
}
static inline fmt::text_style DebugLevelStyle(uint32_t Level) {
switch (Level) {
case LogMan::ASSERT: return fmt::bg(fmt::color::red) | fmt::emphasis::bold | fmt::fg(fmt::color::white);
case LogMan::ERROR: return fmt::fg(fmt::color::red);
case LogMan::DEBUG: return fmt::fg(fmt::color::gray);
case LogMan::INFO: return fmt::fg(fmt::color::green);
default: return {}; break;
}
}
constexpr DebugLevels MSG_LEVEL = INFO;
// Note that all logging functions with the Fmt or _FMT suffix on them expect