mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +00:00
AK: Add dbg()
We have outln() and out(), warnln() and warn(), now we have dbgln() and dbg(). This is useful for printing arrays element-by-element while still only printing one line per array.
This commit is contained in:
parent
e3d182bfe2
commit
0c53b02149
2 changed files with 13 additions and 4 deletions
|
@ -906,7 +906,7 @@ void set_debug_enabled(bool value)
|
|||
is_debug_enabled = value;
|
||||
}
|
||||
|
||||
void vdbgln(StringView fmtstr, TypeErasedFormatParams& params)
|
||||
void vdbg(StringView fmtstr, TypeErasedFormatParams& params, bool newline)
|
||||
{
|
||||
if (!is_debug_enabled)
|
||||
return;
|
||||
|
@ -946,7 +946,8 @@ void vdbgln(StringView fmtstr, TypeErasedFormatParams& params)
|
|||
#endif
|
||||
|
||||
MUST(vformat(builder, fmtstr, params));
|
||||
builder.append('\n');
|
||||
if (newline)
|
||||
builder.append('\n');
|
||||
|
||||
auto const string = builder.string_view();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue