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 /Kernel/Bus | |
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 'Kernel/Bus')
-rw-r--r-- | Kernel/Bus/PCI/Device.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Bus/PCI/Device.h b/Kernel/Bus/PCI/Device.h index 9c1d1fa92e..61a713b664 100644 --- a/Kernel/Bus/PCI/Device.h +++ b/Kernel/Bus/PCI/Device.h @@ -48,7 +48,7 @@ void dmesgln_pci(Device const& device, AK::CheckedFormatString<Parameters...>&& return; if (builder.try_append(fmt.view()).is_error()) return; - AK::VariadicFormatParams variadic_format_params { device.device_name(), device.pci_address(), parameters... }; + AK::VariadicFormatParams<AK::AllowDebugOnlyFormatters::Yes, StringView, Address, Parameters...> variadic_format_params { device.device_name(), device.pci_address(), parameters... }; vdmesgln(builder.string_view(), variadic_format_params); } |