diff --git a/AK/Format.cpp b/AK/Format.cpp index 0132807ed4..60cd2dcfa6 100644 --- a/AK/Format.cpp +++ b/AK/Format.cpp @@ -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. diff --git a/AK/Format.h b/AK/Format.h index 7e6909418b..8b11dcb32c 100644 --- a/AK/Format.h +++ b/AK/Format.h @@ -403,6 +403,8 @@ void dbgln(const char* fmtstr, const Parameters&... parameters) { dbgln template void dbgln() { dbgln(""); } +void set_debug_enabled(bool); + template struct HasFormatter : TrueType { };