mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
LogManager: Use colors for logging when possible
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user