diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 10:39:31 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 10:39:31 +0200 |
commit | 58dfdba241b501d4b1b9688b44ee775507ec325b (patch) | |
tree | 37e4943d8605770e971f83b84039e929be2d043f /src/crepe/util/log.cpp | |
parent | 77555730e3ddb811b9ce8470659663e3f1573de2 (diff) |
add Config + wip rework color
Diffstat (limited to 'src/crepe/util/log.cpp')
-rw-r--r-- | src/crepe/util/log.cpp | 9 |
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); |