diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:03:51 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:03:51 +0100 |
commit | 9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (patch) | |
tree | 3dd74938da60a0de1a77360280c15ff8949d02cf /src/crepe/util | |
parent | 424611c6016e4a189e3a887fabe8e45b637e80f4 (diff) | |
parent | b597af6c64ccf50c7f92a2b78e7950ee3ab230f7 (diff) |
Merge branch 'loek/wrap'
Diffstat (limited to 'src/crepe/util')
-rw-r--r-- | src/crepe/util/LogColor.cpp | 64 | ||||
-rw-r--r-- | src/crepe/util/Proxy.h | 4 | ||||
-rw-r--r-- | src/crepe/util/log.h | 12 |
3 files changed, 23 insertions, 57 deletions
diff --git a/src/crepe/util/LogColor.cpp b/src/crepe/util/LogColor.cpp index b5fe3ea..c0c45a0 100644 --- a/src/crepe/util/LogColor.cpp +++ b/src/crepe/util/LogColor.cpp @@ -42,51 +42,19 @@ LogColor & LogColor::reset() { return *this; } -LogColor & LogColor::fg_black(bool bright) { - return this->add_code(bright ? 90 : 30); -} -LogColor & LogColor::fg_red(bool bright) { - return this->add_code(bright ? 91 : 31); -} -LogColor & LogColor::fg_green(bool bright) { - return this->add_code(bright ? 92 : 32); -} -LogColor & LogColor::fg_yellow(bool bright) { - return this->add_code(bright ? 93 : 33); -} -LogColor & LogColor::fg_blue(bool bright) { - return this->add_code(bright ? 94 : 34); -} -LogColor & LogColor::fg_magenta(bool bright) { - return this->add_code(bright ? 95 : 35); -} -LogColor & LogColor::fg_cyan(bool bright) { - return this->add_code(bright ? 96 : 36); -} -LogColor & LogColor::fg_white(bool bright) { - return this->add_code(bright ? 97 : 37); -} -LogColor & LogColor::bg_black(bool bright) { - return this->add_code(bright ? 100 : 40); -} -LogColor & LogColor::bg_red(bool bright) { - return this->add_code(bright ? 101 : 41); -} -LogColor & LogColor::bg_green(bool bright) { - return this->add_code(bright ? 102 : 42); -} -LogColor & LogColor::bg_yellow(bool bright) { - return this->add_code(bright ? 103 : 43); -} -LogColor & LogColor::bg_blue(bool bright) { - return this->add_code(bright ? 104 : 44); -} -LogColor & LogColor::bg_magenta(bool bright) { - return this->add_code(bright ? 105 : 45); -} -LogColor & LogColor::bg_cyan(bool bright) { - return this->add_code(bright ? 106 : 46); -} -LogColor & LogColor::bg_white(bool bright) { - return this->add_code(bright ? 107 : 47); -} +LogColor & LogColor::fg_black(bool bright) { return this->add_code(bright ? 90 : 30); } +LogColor & LogColor::fg_red(bool bright) { return this->add_code(bright ? 91 : 31); } +LogColor & LogColor::fg_green(bool bright) { return this->add_code(bright ? 92 : 32); } +LogColor & LogColor::fg_yellow(bool bright) { return this->add_code(bright ? 93 : 33); } +LogColor & LogColor::fg_blue(bool bright) { return this->add_code(bright ? 94 : 34); } +LogColor & LogColor::fg_magenta(bool bright) { return this->add_code(bright ? 95 : 35); } +LogColor & LogColor::fg_cyan(bool bright) { return this->add_code(bright ? 96 : 36); } +LogColor & LogColor::fg_white(bool bright) { return this->add_code(bright ? 97 : 37); } +LogColor & LogColor::bg_black(bool bright) { return this->add_code(bright ? 100 : 40); } +LogColor & LogColor::bg_red(bool bright) { return this->add_code(bright ? 101 : 41); } +LogColor & LogColor::bg_green(bool bright) { return this->add_code(bright ? 102 : 42); } +LogColor & LogColor::bg_yellow(bool bright) { return this->add_code(bright ? 103 : 43); } +LogColor & LogColor::bg_blue(bool bright) { return this->add_code(bright ? 104 : 44); } +LogColor & LogColor::bg_magenta(bool bright) { return this->add_code(bright ? 105 : 45); } +LogColor & LogColor::bg_cyan(bool bright) { return this->add_code(bright ? 106 : 46); } +LogColor & LogColor::bg_white(bool bright) { return this->add_code(bright ? 107 : 47); } diff --git a/src/crepe/util/Proxy.h b/src/crepe/util/Proxy.h index f84e462..b34f7c6 100644 --- a/src/crepe/util/Proxy.h +++ b/src/crepe/util/Proxy.h @@ -7,8 +7,8 @@ namespace crepe { /** * \brief Utility wrapper for \c ValueBroker * - * This class can be used to to wrap a ValueBroker instance so it behaves like - * a regular variable. + * This class can be used to to wrap a ValueBroker instance so it behaves like a regular + * variable. * * \tparam T Type of the underlying variable */ diff --git a/src/crepe/util/log.h b/src/crepe/util/log.h index 5a1cf00..00b5810 100644 --- a/src/crepe/util/log.h +++ b/src/crepe/util/log.h @@ -7,16 +7,14 @@ // utility macros #define _crepe_logf_here(level, format, ...) \ - crepe::logf( \ - level, "%s" format, \ - crepe::LogColor().fg_white(false).fmt( \ - "%s (%s:%d)", __PRETTY_FUNCTION__, __FILE_NAME__, __LINE__), \ - __VA_ARGS__) + crepe::logf(level, "%s" format, \ + crepe::LogColor().fg_white(false).fmt("%s (%s:%d)", __PRETTY_FUNCTION__, \ + __FILE_NAME__, __LINE__), \ + __VA_ARGS__) // very illegal global function-style macros // NOLINTBEGIN -#define dbg_logf(fmt, ...) \ - _crepe_logf_here(crepe::LogLevel::DEBUG, ": " fmt, __VA_ARGS__) +#define dbg_logf(fmt, ...) _crepe_logf_here(crepe::LogLevel::DEBUG, ": " fmt, __VA_ARGS__) #define dbg_log(str) _crepe_logf_here(crepe::LogLevel::DEBUG, "%s: " str, "") #define dbg_trace() _crepe_logf_here(crepe::LogLevel::TRACE, "%s", "") // NOLINTEND |