summaryrefslogtreecommitdiff
path: root/AK/Format.h
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-23 13:58:23 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-23 16:46:26 +0100
commita7d5fbb8afd99fff8d073e21cf27bcccb440e768 (patch)
tree5f9d9248f72f05d2b2d170c75f78a85ab9f669fd /AK/Format.h
parent1c1e577a5ef92770ed8103cf1f763b9024c49192 (diff)
downloadserenity-a7d5fbb8afd99fff8d073e21cf27bcccb440e768.zip
AK+Format: Add dmesgln() to replace klog().
Diffstat (limited to 'AK/Format.h')
-rw-r--r--AK/Format.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/AK/Format.h b/AK/Format.h
index 8b11dcb32c..ae4846eed6 100644
--- a/AK/Format.h
+++ b/AK/Format.h
@@ -405,6 +405,16 @@ void dbgln() { dbgln<enabled>(""); }
void set_debug_enabled(bool);
+#ifdef KERNEL
+void vdmesgln(StringView fmtstr, TypeErasedFormatParams);
+
+template<typename... Parameters>
+void dmesgln(StringView fmtstr, const Parameters&... parameters) { vdmesgln(fmtstr, VariadicFormatParams { parameters... }); }
+template<typename... Parameters>
+void dmesgln(const char* fmtstr, const Parameters&... parameters) { vdmesgln(fmtstr, VariadicFormatParams { parameters... }); }
+inline void dmesgln() { dmesgln(""); }
+#endif
+
template<typename T, typename = void>
struct HasFormatter : TrueType {
};
@@ -459,7 +469,9 @@ struct Formatter<FormatString> : Formatter<String> {
} // namespace AK
-#ifndef KERNEL
+#ifdef KERNEL
+using AK::dmesgln;
+#else
using AK::out;
using AK::outln;