35 lines
1008 B
C++
35 lines
1008 B
C++
|
/***
|
||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: EventLog.Win32.hpp
|
||
|
Date: 2022-2-13
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
namespace Aurora::Logging::Sinks
|
||
|
{
|
||
|
struct EventLogSink : IBasicSink
|
||
|
{
|
||
|
EventLogSink(const AuString &value);
|
||
|
~EventLogSink();
|
||
|
|
||
|
void OnMessageBlocking(AuUInt8 level, const ConsoleMessage &msg) override;
|
||
|
bool OnMessageNonblocking(AuUInt8 level, const ConsoleMessage &msg) override;
|
||
|
void OnFlush() override;
|
||
|
|
||
|
private:
|
||
|
|
||
|
void FlushStrings();
|
||
|
|
||
|
HANDLE winCurrentSink_;
|
||
|
WORD winCurrentType_;
|
||
|
std::wstring winArrayBuffer_;
|
||
|
AuList<AuTuple<WORD, std::wstring>> winCompleteArrayBuffer_;
|
||
|
AuThreadPrimitives::SpinLock spinLock_;
|
||
|
};
|
||
|
|
||
|
|
||
|
void NewOSNamedEventDirectorySinkRelease(IBasicSink *sink);
|
||
|
IBasicSink *NewOSNamedEventDirectorySinkNew(const AuString &name);
|
||
|
}
|