From 9b7be419c9dcc6ebd1e504713c7b2676ca3d2fdf Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 23 Oct 2024 21:54:28 +0200 Subject: `clang-format` --- src/crepe/util/log.cpp | 14 +++++++------- src/crepe/util/log.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/crepe/util') 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 -- cgit v1.2.3