120 lines
2.9 KiB
C++
120 lines
2.9 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuLogSinks.cpp
|
|
Date: 2022-1-21
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "AuLogSinks.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 IFormattedSink *NewStdSinkNew()
|
|
{
|
|
return Sinks::NewStdSinkNew();
|
|
}
|
|
|
|
AUKN_SYM void NewStdSinkRelease(IFormattedSink *pSink)
|
|
{
|
|
Sinks::NewStdSinkRelease(pSink);
|
|
}
|
|
|
|
AUKN_SYM IBasicSink *NewOSEventDirectorySinkNew()
|
|
{
|
|
return {};
|
|
}
|
|
|
|
AUKN_SYM void NewOSEventDirectorySinkRelease(IBasicSink *pSink)
|
|
{}
|
|
|
|
|
|
AUKN_SYM IBasicSink *NewDebugLoggerNew()
|
|
{
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
return Sinks::NewDebugLoggerNew();
|
|
#endif
|
|
return {};
|
|
}
|
|
|
|
AUKN_SYM void NewDebugLoggerRelease(IBasicSink *pSink)
|
|
{
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
return Sinks::NewDebugLoggerRelease(pSink);
|
|
#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 *pSink)
|
|
{
|
|
#if defined(AURORA_PLATFORM_WIN32) || defined(AURORA_IS_POSIX_DERIVED)
|
|
Sinks::NewOSNamedEventDirectorySinkRelease(pSink);
|
|
#endif
|
|
}
|
|
|
|
AUKN_SYM IBasicSink *NewDirectorySinkNew(const AuString &path, DirectoryLogger dirInfo, bool bBinary)
|
|
{
|
|
return Sinks::NewDirectoryLoggerNew(path, dirInfo, bBinary);
|
|
}
|
|
|
|
AUKN_SYM void NewDirectorySinkRelease(IBasicSink *pSink)
|
|
{
|
|
Sinks::NewDirectoryLoggerRelease(pSink);
|
|
}
|
|
|
|
|
|
AUKN_SYM IFormattedSink *NewFileSinkNew(const AuString &path, bool bBinary)
|
|
{
|
|
return Sinks::NewFileSinkNew(path, bBinary);
|
|
}
|
|
|
|
AUKN_SYM void NewFileSinkRelease(IFormattedSink *pSink)
|
|
{
|
|
Sinks::NewFileSinkRelease(pSink);
|
|
}
|
|
|
|
AUKN_SYM IIPCLogger *NewIPCSinkNew(const AuString &path, bool lengthPrefixed)
|
|
{
|
|
return Sinks::NewIPCSinkNew(path, lengthPrefixed);
|
|
}
|
|
|
|
AUKN_SYM void NewIPCSinkRelease(IIPCLogger *pSink)
|
|
{
|
|
Sinks::NewIPCSinkRelease(pSink);
|
|
}
|
|
|
|
AUKN_SYM IBasicSinkRB *NewRingLoggerNew(AuUInt32 maxLogEntries)
|
|
{
|
|
return Sinks::NewRingBufferNew(maxLogEntries);
|
|
}
|
|
|
|
AUKN_SYM void NewRingLoggerRelease(IBasicSinkRB *pSink)
|
|
{
|
|
Sinks::NewRingBufferRelease(pSink);
|
|
}
|
|
} |