diff options
author | MacDue <macdue@dueutil.tech> | 2023-01-13 02:19:40 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-13 21:09:26 +0000 |
commit | 9a120d7243ea28ac61a8bda477910ee2c7ea159b (patch) | |
tree | 0acd906b498f83bd871d0eb4035ecf81218addb8 /AK/DeprecatedString.h | |
parent | 13883753109ae1253d0f36a5cc9e4a45b3084c12 (diff) | |
download | serenity-9a120d7243ea28ac61a8bda477910ee2c7ea159b.zip |
AK: Add support for "debug only" formatters
These are formatters that can only be used with debug print
functions, such as dbgln(). Currently this is limited to
Formatter<ErrorOr<T>>. With this you can still debug log ErrorOr
values (good for debugging), but trying to use them in any
String::formatted() call will fail (which prevents .to_string()
errors with the new failable strings being ignored).
You make a formatter debug only by adding a constexpr method like:
static constexpr bool is_debug_only() { return true; }
Diffstat (limited to 'AK/DeprecatedString.h')
-rw-r--r-- | AK/DeprecatedString.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/DeprecatedString.h b/AK/DeprecatedString.h index f9e09ae0f1..a77130161e 100644 --- a/AK/DeprecatedString.h +++ b/AK/DeprecatedString.h @@ -284,7 +284,7 @@ public: template<typename... Parameters> [[nodiscard]] static DeprecatedString formatted(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters) { - VariadicFormatParams variadic_format_parameters { parameters... }; + VariadicFormatParams<AllowDebugOnlyFormatters::No, Parameters...> variadic_format_parameters { parameters... }; return vformatted(fmtstr.view(), variadic_format_parameters); } |