38 lines
998 B
C++
38 lines
998 B
C++
|
/***
|
||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: StdConsole.cpp
|
||
|
Date: 2022-2-5
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#include <Source/RuntimeInternal.hpp>
|
||
|
#include "StdConsole.hpp"
|
||
|
#include <Source/Console/ConsoleStd/ConsoleStd.hpp>
|
||
|
|
||
|
namespace Aurora::Logging::Sinks
|
||
|
{
|
||
|
void ConsoleStdLogger::OnMessageBlocking(AuUInt8 level, const ConsoleMessage &msg)
|
||
|
{
|
||
|
if (!gRuntimeConfig.console.asyncWrite) return;
|
||
|
Console::ConsoleStd::WriteStdOut(level, msg);
|
||
|
}
|
||
|
|
||
|
bool ConsoleStdLogger::OnMessageNonblocking(AuUInt8 level, const ConsoleMessage &msg)
|
||
|
{
|
||
|
if (gRuntimeConfig.console.asyncWrite) return true;
|
||
|
Console::ConsoleStd::WriteStdOut(level, msg);
|
||
|
return {};
|
||
|
}
|
||
|
|
||
|
// Flushing is handled by grug -> console subsystem -> console std
|
||
|
void ConsoleStdLogger::OnFlush()
|
||
|
{}
|
||
|
|
||
|
IBasicSink *NewStdSinkNew()
|
||
|
{
|
||
|
return &gStdConsoleSink;
|
||
|
}
|
||
|
|
||
|
void NewStdSinkRelease(IBasicSink *registry)
|
||
|
{}
|
||
|
}
|