/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: Logger.hpp Date: 2022-1-21 Author: Reece ***/ #pragma once namespace Aurora::Logging { inline AuSPtr gUserLogger; struct Logger : ILogger { Logger(const AuList> &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> sinks; AuList> filters; // std::vector > std::stack performance. dont ask me why or for the benchmarks, just trust me bro AuUInt8 shouldFilter[0xFF]; }; void ForceFlushLoggers(); void ForceFlushFlush(); void DeinitLoggers(); void InitLoggers(); }