mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
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…
Reference in New Issue
Block a user