mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 04:52:23 +00:00
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:
parent
9582895759
commit
86dc3ce001
Notes:
github-actions[bot]
2025-07-18 18:40:57 +00:00
Author: https://github.com/gmta
Commit: 86dc3ce001
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5473
1 changed files with 11 additions and 7 deletions
18
AK/Format.h
18
AK/Format.h
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue