AuroraRuntime/Source/Logging/Sinks.cpp

120 lines
2.8 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Sinks.cpp
Date: 2022-1-21
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "Sinks.hpp"
#include "Sinks/FileSink.hpp"
#include "Sinks/StdConsole.hpp"
#include "Sinks/RingBuffer.hpp"
#include "Sinks/DirLogArchive.hpp"
#include "Sinks/IPCSink.hpp"
#if defined(AURORA_PLATFORM_WIN32)
#include "Sinks/EventLog.Win32.hpp"
#endif
#if defined(AURORA_IS_MODERNNT_DERIVED)
#include "Sinks/DebugLogger.NT.hpp"
#endif
#if defined(AURORA_IS_POSIX_DERIVED)
#include "Sinks/SysLog.Unix.hpp"
#endif
namespace Aurora::Logging
{
AUKN_SYM IBasicSink *NewStdSinkNew()
{
return Sinks::NewStdSinkNew();
}
AUKN_SYM void NewStdSinkRelease(IBasicSink *sink)
{
Sinks::NewStdSinkRelease(sink);
}
AUKN_SYM IBasicSink *NewOSEventDirectorySinkNew()
{
return {};
}
AUKN_SYM void NewOSEventDirectorySinkRelease(IBasicSink *sink)
{}
AUKN_SYM IBasicSink *NewDebugLoggerNew()
{
#if defined(AURORA_IS_MODERNNT_DERIVED)
return Sinks::NewDebugLoggerNew();
#endif
return {};
}
AUKN_SYM void NewDebugLoggerRelease(IBasicSink *sink)
{
#if defined(AURORA_IS_MODERNNT_DERIVED)
return Sinks::NewDebugLoggerRelease(sink);
#endif
}
AUKN_SYM IBasicSink *NewOSNamedEventDirectorySinkNew(const AuString &name)
{
#if defined(AURORA_PLATFORM_WIN32) || defined(AURORA_IS_POSIX_DERIVED)
return Sinks::NewOSNamedEventDirectorySinkNew(name);
#endif
return {};
}
AUKN_SYM void NewOSNamedEventDirectorySinkRelease(IBasicSink *sink)
{
#if defined(AURORA_PLATFORM_WIN32) || defined(AURORA_IS_POSIX_DERIVED)
Sinks::NewOSNamedEventDirectorySinkRelease(sink);
#endif
}
AUKN_SYM IBasicSink *NewDirectorySinkNew(const AuString &path, DirectoryLogger dirInfo, bool binary)
{
return Sinks::NewDirectoryLoggerNew(path, dirInfo, binary);
}
AUKN_SYM void NewDirectorySinkRelease(IBasicSink *sink)
{
Sinks::NewDirectoryLoggerRelease(sink);
}
AUKN_SYM IBasicSink *NewFileSinkNew(const AuString &path, bool binary)
{
return Sinks::NewFileSinkNew(path, binary);
}
AUKN_SYM void NewFileSinkRelease(IBasicSink *sink)
{
Sinks::NewFileSinkRelease(sink);
}
AUKN_SYM IIPCLogger *NewIPCSinkNew(const AuString &path, bool lengthPrefixed)
{
return Sinks::NewIPCSinkNew(path, lengthPrefixed);
}
AUKN_SYM void NewIPCSinkRelease(IIPCLogger *sink)
{
Sinks::NewIPCSinkRelease(sink);
}
AUKN_SYM IBasicSinkRB *NewRingLoggerNew(AuUInt32 maxLogEntries)
{
return Sinks::NewRingBufferNew(maxLogEntries);
}
AUKN_SYM void NewRingLoggerRelease(IBasicSinkRB *sink)
{
Sinks::NewRingBufferRelease(sink);
}
}