AuroraRuntime/Source/Logging/AuLogger.hpp
Reece 85a575eb95 [+] Network interfaces API
[+] Logger IFormatter API
[*] Clean up
2022-12-14 20:08:52 +00:00

45 lines
1.3 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuLogger.hpp
Date: 2022-1-21
Author: Reece
***/
#pragma once
namespace Aurora::Logging
{
inline AuSPtr<ILogger> gUserLogger;
struct Logger : ILogger
{
Logger(const AuList<AuSPtr<IBasicSink>> &sinks);
~Logger();
void WriteMessage(AuUInt8 level, const ConsoleMessage &msg) override;
void PushFilter(AuUInt8 level, bool shouldFilter) override;
void PopFilter() override;
void AddToPushQueue(AuUInt8 level, const ConsoleMessage &msg);
bool WriteNow(AuUInt8 level, const ConsoleMessage &msg);
void WriteLater(AuUInt8 level, const ConsoleMessage &msg);
void WriteLines(AuUInt8 level, const ConsoleMessage &msg);
void Disable();
AuThreadPrimitives::SpinLock spin;
AuList<AuSPtr<IBasicSink>> sinks;
AuList<AuTuple<AuUInt8, bool>> filters; // std::vector > std::stack performance. dont ask me why or for the benchmarks, just trust me bro
AuUInt8 shouldFilter[0xFF];
};
AuThreadPrimitives::SpinLock &GetLock();
void ForceFlushLoggers();
void ForceFlushLoggersNoLock();
void ForceFlushFlush();
void DeinitLoggers();
void InitLoggers();
}