1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

AK: Add set_debug_enabled method.

This commit is contained in:
asynts 2021-01-18 17:37:30 +01:00 committed by Andreas Kling
parent 3179065466
commit 663a6141d8
2 changed files with 12 additions and 0 deletions

View file

@ -652,8 +652,18 @@ void vout(FILE* file, StringView fmtstr, TypeErasedFormatParams params, bool new
}
#endif
static bool is_debug_enabled = true;
void set_debug_enabled(bool value)
{
is_debug_enabled = value;
}
void vdbgln(StringView fmtstr, TypeErasedFormatParams params)
{
if (!is_debug_enabled)
return;
StringBuilder builder;
// FIXME: This logic is redundant with the stuff in LogStream.cpp.