aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util/log.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 10:39:31 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 10:39:31 +0200
commit58dfdba241b501d4b1b9688b44ee775507ec325b (patch)
tree37e4943d8605770e971f83b84039e929be2d043f /src/crepe/util/log.cpp
parent77555730e3ddb811b9ce8470659663e3f1573de2 (diff)
add Config + wip rework color
Diffstat (limited to 'src/crepe/util/log.cpp')
-rw-r--r--src/crepe/util/log.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/crepe/util/log.cpp b/src/crepe/util/log.cpp
index f91d52c..ba12ba5 100644
--- a/src/crepe/util/log.cpp
+++ b/src/crepe/util/log.cpp
@@ -4,17 +4,22 @@
#include <string>
#include "log.h"
+#include "../api/Config.h"
using namespace crepe::util;
static const char * const LOG_PREFIX[] = {
- [log_level::DEBUG] = "[DBG] ",
+ [log_level::TRACE] = "[TRACE] ",
+ [log_level::DEBUG] = "[DEBUG] ",
[log_level::INFO] = "[INFO] ",
[log_level::WARNING] = "[WARN] ",
- [log_level::ERROR] = "[ERR] ",
+ [log_level::ERROR] = "[ERROR] ",
};
static void va_logf(enum log_level level, va_list args, const std::string fmt) {
+ auto & cfg = crepe::api::Config::get_instance();
+ if (level < cfg.log.level) return;
+
va_list args_copy;
va_copy(args_copy, args);