mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add enabled template parameter to dbgln.
This commit is contained in:
parent
971425d7b1
commit
4953c73fc1
Notes:
sideshowbarker
2024-07-18 23:11:43 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/4953c73fc17 Pull-request: https://github.com/SerenityOS/serenity/pull/4931 Reviewed-by: https://github.com/emanuele6
2 changed files with 10 additions and 14 deletions
15
AK/Format.h
15
AK/Format.h
|
@ -392,11 +392,16 @@ inline void warnln() { outln(stderr); }
|
|||
|
||||
void vdbgln(StringView fmtstr, TypeErasedFormatParams);
|
||||
|
||||
template<typename... Parameters>
|
||||
void dbgln(StringView fmtstr, const Parameters&... parameters) { vdbgln(fmtstr, VariadicFormatParams { parameters... }); }
|
||||
template<typename... Parameters>
|
||||
void dbgln(const char* fmtstr, const Parameters&... parameters) { dbgln(StringView { fmtstr }, parameters...); }
|
||||
inline void dbgln() { dbgln(""); }
|
||||
template<bool enabled = true, typename... Parameters>
|
||||
void dbgln(StringView fmtstr, const Parameters&... parameters)
|
||||
{
|
||||
if constexpr (enabled)
|
||||
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>
|
||||
struct HasFormatter : TrueType {
|
||||
|
|
|
@ -133,15 +133,6 @@ class WeakPtr;
|
|||
template<typename T, size_t inline_capacity = 0>
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue