AK: Add dbgln_dump() macro

This turns:

  dbgln_dump(some_expression() + 1);

Into:

  dbgln("some_expression() + 1: {}", (some_expression() + 1));
This commit is contained in:
Jelle Raaijmakers 2025-07-16 15:50:31 +02:00 committed by Tim Flynn
commit 86dc3ce001
Notes: github-actions[bot] 2025-07-18 18:40:57 +00:00

View file

@ -715,6 +715,17 @@ void set_log_tag_name(char const*);
warnln(fmt, ##__VA_ARGS__); \
} while (0)
#define dbgln_if(flag, fmt, ...) \
do { \
if constexpr (flag) \
dbgln(fmt, ##__VA_ARGS__); \
} while (0)
#define dbgln_dump(expr) \
do { \
dbgln(#expr ": {}", (expr)); \
} while (0)
void vdbg(StringView fmtstr, TypeErasedFormatParams&, bool newline = false);
template<typename... Parameters>
@ -842,11 +853,4 @@ using AK::dbgln;
using AK::CheckedFormatString;
using AK::FormatIfSupported;
using AK::FormatString;
# define dbgln_if(flag, fmt, ...) \
do { \
if constexpr (flag) \
dbgln(fmt, ##__VA_ARGS__); \
} while (0)
#endif