AuroraRuntime/Source/Console/ConsoleFIO/FileSink.hpp
Reece e5e36bd887 Large Commit
[*] Fix deadlock in the async subsystem (NoLockShutdown vs Shutdown in exception handler)
[+] Added ProccessMap NT variant
[+] Added ToolHelp image profiling
[*] Improved exception awareness
[*] Delegated SpawnThread to isolated TU, ready for reuse for RunAs and XNU Open - now with horrible evil alloc that could fail
[+] Added header for future api 'UtilRun'
[*] Improve NT core detection
[*] Changed small affinity bitmap to AuUInt64 instead of AuUInt32
[+] Added data structure to hold cpuids/affinity masks
[+] Implemented logger sinks
[+] Implemented logger glue logic
[*] Began migrating older loggers to sink-based default devices
[*] Minor refactors
[*] Improved internal exception discarding, not yet nothrow capable
[*] Minor create directory fix
2022-01-24 18:43:53 +00:00

31 lines
838 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: FileSink.hpp
Date: 2022-1-24
Author: Reece
***/
#pragma once
namespace Aurora::Console::ConsoleFIO
{
struct FIOSink : IBasicSink
{
FIOSink(const AuString &path);
bool Init();
void OnMessageBlocking(AuUInt8 level, const ConsoleMessage &msg) override;
void OnMessageNonblocking(AuUInt8 level, const ConsoleMessage &msg) override;
void OnFlush() override;
private:
const AuString path_;
AuIOFS::OpenWriteUnique_t file_;
AuList<AuUInt8> logBuffer_;
AuThreadPrimitives::RWLockUnique_t logMutex_;
};
void NewFileSinkRelease(IBasicSink *logger);
IBasicSink *NewFileSinkNew(const AuString &str);
}