mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
AK: Add enabled template parameter to dbgln.
This commit is contained in:
parent
971425d7b1
commit
4953c73fc1
15
AK/Format.h
15
AK/Format.h
|
@ -392,11 +392,16 @@ inline void warnln() { outln(stderr); }
|
||||||
|
|
||||||
void vdbgln(StringView fmtstr, TypeErasedFormatParams);
|
void vdbgln(StringView fmtstr, TypeErasedFormatParams);
|
||||||
|
|
||||||
template<typename... Parameters>
|
template<bool enabled = true, typename... Parameters>
|
||||||
void dbgln(StringView fmtstr, const Parameters&... parameters) { vdbgln(fmtstr, VariadicFormatParams { parameters... }); }
|
void dbgln(StringView fmtstr, const Parameters&... parameters)
|
||||||
template<typename... Parameters>
|
{
|
||||||
void dbgln(const char* fmtstr, const Parameters&... parameters) { dbgln(StringView { fmtstr }, parameters...); }
|
if constexpr (enabled)
|
||||||
inline void dbgln() { dbgln(""); }
|
vdbgln(fmtstr, VariadicFormatParams { parameters... });
|
||||||
|
}
|
||||||
|
template<bool enabled = true, typename... Parameters>
|
||||||
|
void dbgln(const char* fmtstr, const Parameters&... parameters) { dbgln<enabled>(StringView { fmtstr }, parameters...); }
|
||||||
|
template<bool enabled = true>
|
||||||
|
void dbgln() { dbgln<enabled>(""); }
|
||||||
|
|
||||||
template<typename T, typename = void>
|
template<typename T, typename = void>
|
||||||
struct HasFormatter : TrueType {
|
struct HasFormatter : TrueType {
|
||||||
|
|
|
@ -133,15 +133,6 @@ class WeakPtr;
|
||||||
template<typename T, size_t inline_capacity = 0>
|
template<typename T, size_t inline_capacity = 0>
|
||||||
class Vector;
|
class Vector;
|
||||||
|
|
||||||
template<typename... Parameters>
|
|
||||||
void dbgln(const char* fmtstr, const Parameters&...);
|
|
||||||
|
|
||||||
template<typename... Parameters>
|
|
||||||
void warnln(const char* fmtstr, const Parameters&...);
|
|
||||||
|
|
||||||
template<typename... Parameters>
|
|
||||||
void outln(const char* fmtstr, const Parameters&...);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using AK::Array;
|
using AK::Array;
|
||||||
|
|
Loading…
Reference in a new issue