aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-23 21:54:28 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-23 21:54:28 +0200
commit9b7be419c9dcc6ebd1e504713c7b2676ca3d2fdf (patch)
tree97a2fc5ce1ec1345bd6f44889682ea9a2ffafd76 /src/crepe/util
parent080ad535e6fc6666b919b1a21b6986aaf9b678eb (diff)
`clang-format`
Diffstat (limited to 'src/crepe/util')
-rw-r--r--src/crepe/util/log.cpp14
-rw-r--r--src/crepe/util/log.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/crepe/util/log.cpp b/src/crepe/util/log.cpp
index 0c2ce1e..b869aad 100644
--- a/src/crepe/util/log.cpp
+++ b/src/crepe/util/log.cpp
@@ -9,13 +9,13 @@
using namespace crepe::util;
static const char * const LOG_PREFIX[] = {
- [log_level::DEBUG] = "[DBG] ",
- [log_level::INFO] = "[INFO] ",
- [log_level::WARNING] = "[WARN] ",
- [log_level::ERROR] = "[ERR] ",
+ [LogLevel::DEBUG] = "[DBG] ",
+ [LogLevel::INFO] = "[INFO] ",
+ [LogLevel::WARNING] = "[WARN] ",
+ [LogLevel::ERROR] = "[ERR] ",
};
-static void log(enum log_level level, const std::string & msg) {
+static void log(LogLevel level, const std::string & msg) {
using namespace std;
string out = string(LOG_PREFIX[level]) + msg;
if (!out.ends_with("\n")) out += "\n";
@@ -28,11 +28,11 @@ static void log(enum log_level level, const std::string & msg) {
void crepe::util::logf(const char * fmt, ...) {
va_list args;
va_start(args, fmt);
- log(log_level::DEBUG, va_stringf(args, fmt));
+ log(LogLevel::DEBUG, va_stringf(args, fmt));
va_end(args);
}
-void crepe::util::logf(log_level level, const char * fmt, ...) {
+void crepe::util::logf(LogLevel level, const char * fmt, ...) {
va_list args;
va_start(args, fmt);
log(level, va_stringf(args, fmt));
diff --git a/src/crepe/util/log.h b/src/crepe/util/log.h
index 3e36f0a..f8e4f00 100644
--- a/src/crepe/util/log.h
+++ b/src/crepe/util/log.h
@@ -7,7 +7,7 @@
// utility macros
#define _crepe_logf_here(fmt, ...) \
- crepe::util::logf(util::log_level::DEBUG, "%s%s (%s:%d)%s" fmt "\n", \
+ crepe::util::logf(util::LogLevel::DEBUG, "%s%s (%s:%d)%s" fmt "\n", \
crepe::util::color::FG_WHITE, __PRETTY_FUNCTION__, \
__FILE_NAME__, __LINE__, crepe::util::color::RESET, \
__VA_ARGS__)
@@ -23,7 +23,7 @@
namespace crepe::util {
-enum log_level {
+enum LogLevel {
DEBUG,
INFO,
WARNING,
@@ -31,6 +31,6 @@ enum log_level {
};
void logf(const char * fmt, ...);
-void logf(enum log_level level, const char * fmt, ...);
+void logf(enum LogLevel level, const char * fmt, ...);
} // namespace crepe::util