From 5e59c22f77073fdf49bf98697da6a68819eb5776 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 13 Nov 2024 15:50:13 +0100 Subject: `make format` --- src/crepe/util/Log.cpp | 1 - src/crepe/util/Log.h | 17 +++++++++++------ src/crepe/util/Log.hpp | 12 ++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src/crepe/util') diff --git a/src/crepe/util/Log.cpp b/src/crepe/util/Log.cpp index 346e08e..e583734 100644 --- a/src/crepe/util/Log.cpp +++ b/src/crepe/util/Log.cpp @@ -36,4 +36,3 @@ void Log::log(const Level & level, const string & msg) { fwrite(out.c_str(), 1, out.size(), stdout); fflush(stdout); } - diff --git a/src/crepe/util/Log.h b/src/crepe/util/Log.h index 4e32e9d..01452b2 100644 --- a/src/crepe/util/Log.h +++ b/src/crepe/util/Log.h @@ -8,7 +8,12 @@ #include "LogColor.h" // utility macros -#define _crepe_logf_here(level, fmt, ...) crepe::Log::logf(level, "{}" fmt, crepe::LogColor().fg_white(false).str(std::format("{} ({}:{})", __PRETTY_FUNCTION__, __FILE_NAME__, __LINE__)), __VA_ARGS__) +#define _crepe_logf_here(level, fmt, ...) \ + crepe::Log::logf( \ + level, "{}" fmt, \ + crepe::LogColor().fg_white(false).str(std::format( \ + "{} ({}:{})", __PRETTY_FUNCTION__, __FILE_NAME__, __LINE__)), \ + __VA_ARGS__) // very illegal global function-style macros // NOLINTBEGIN @@ -53,8 +58,9 @@ public: * \param fmt Message format * \param args Format arguments */ - template - static void logf(const Level & level, std::format_string fmt, Args&&... args); + template + static void logf(const Level & level, std::format_string fmt, + Args &&... args); /** * \brief Format a message and log it (with default severity \c INFO) @@ -62,8 +68,8 @@ public: * \param fmt Message format * \param args Format arguments */ - template - static void logf(std::format_string fmt, Args&&... args); + template + static void logf(std::format_string fmt, Args &&... args); private: /** @@ -77,4 +83,3 @@ private: } // namespace crepe #include "Log.hpp" - diff --git a/src/crepe/util/Log.hpp b/src/crepe/util/Log.hpp index 58ba475..651f076 100644 --- a/src/crepe/util/Log.hpp +++ b/src/crepe/util/Log.hpp @@ -4,15 +4,15 @@ namespace crepe { -template -void Log::logf(std::format_string fmt, Args&&... args) { +template +void Log::logf(std::format_string fmt, Args &&... args) { Log::logf(Level::INFO, fmt, std::forward(args)...); } -template -void Log::logf(const Level & level, std::format_string fmt, Args&&... args) { +template +void Log::logf(const Level & level, std::format_string fmt, + Args &&... args) { Log::log(level, std::format(fmt, std::forward(args)...)); } -} - +} // namespace crepe -- cgit v1.2.3