mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:38:10 +00:00
AK: Provide off-switch for dbg() output
This commit is contained in:
parent
b29f4add6b
commit
1ef26e0c09
2 changed files with 20 additions and 1 deletions
|
@ -163,13 +163,25 @@ KernelLogStream::~KernelLogStream()
|
|||
|
||||
DebugLogStream::~DebugLogStream()
|
||||
{
|
||||
if (!empty()) {
|
||||
if (!empty() && s_enabled) {
|
||||
char newline = '\n';
|
||||
write(&newline, 1);
|
||||
dbgputstr(reinterpret_cast<char*>(data()), size());
|
||||
}
|
||||
}
|
||||
|
||||
void DebugLogStream::set_enabled(bool enabled)
|
||||
{
|
||||
s_enabled = enabled;
|
||||
}
|
||||
|
||||
bool DebugLogStream::is_enabled()
|
||||
{
|
||||
return s_enabled;
|
||||
}
|
||||
|
||||
bool DebugLogStream::s_enabled = true;
|
||||
|
||||
#ifndef KERNEL
|
||||
StdLogStream::~StdLogStream()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue