diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 21:32:30 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 21:32:30 +0100 |
commit | a6803980f1e74ecf1abb007b7c77f00d2cd92c43 (patch) | |
tree | 425ca961b27117d6e5d5fa0ae5cfca93351e0b33 /src/crepe/util/dbg.h | |
parent | 6bc0025e4c24ed6659d993f3469c10615fb0e273 (diff) | |
parent | 525636bb2158ecea68ebb9d6b8d2dc722524c5e5 (diff) |
merge master into loek/doxygen
Diffstat (limited to 'src/crepe/util/dbg.h')
-rw-r--r-- | src/crepe/util/dbg.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/crepe/util/dbg.h b/src/crepe/util/dbg.h new file mode 100644 index 0000000..e448070 --- /dev/null +++ b/src/crepe/util/dbg.h @@ -0,0 +1,21 @@ +#pragma once + +#include "Log.h" +#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__ \ + ) + +// very illegal global function-style macros +// NOLINTBEGIN +#define dbg_logf(fmt, ...) _crepe_logf_here(crepe::Log::Level::DEBUG, ": " fmt, __VA_ARGS__) +#define dbg_log(str) _crepe_logf_here(crepe::Log::Level::DEBUG, ": {}", str) +#define dbg_trace() _crepe_logf_here(crepe::Log::Level::TRACE, "", "") +// NOLINTEND |