1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

AK: Add support for Kernel Log Stream

This commit is contained in:
Liav A 2020-02-28 17:10:30 +02:00 committed by Andreas Kling
parent dc01a71fac
commit 9440c45d6e
2 changed files with 45 additions and 0 deletions

View file

@ -70,6 +70,19 @@ public:
}
};
#if !defined(BOOTSTRAPPER) && defined(KERNEL)
class KernelLogStream final : public LogStream {
public:
KernelLogStream() {}
virtual ~KernelLogStream() override;
virtual void write(const char* characters, int length) const override
{
kernelputstr(characters, length);
}
};
#endif
inline const LogStream& operator<<(const LogStream& stream, const char* value)
{
int length = 0;
@ -103,7 +116,14 @@ inline const LogStream& operator<<(const LogStream& stream, bool value)
DebugLogStream dbg();
#if defined(KERNEL)
KernelLogStream klog();
#elif !defined(BOOTSTRAPPER)
DebugLogStream klog();
#endif
}
using AK::dbg;
using AK::klog;
using AK::LogStream;