61 lines
1.7 KiB
C++
61 lines
1.7 KiB
C++
|
/***
|
||
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: Sinks.hpp
|
||
|
Date: 2021-11-2
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
namespace Aurora
|
||
|
{
|
||
|
struct SocketConsole;
|
||
|
}
|
||
|
|
||
|
namespace Aurora::Logging
|
||
|
{
|
||
|
struct DirectoryLogger
|
||
|
{
|
||
|
AuUInt32 maxLogsOrZero {};
|
||
|
AuUInt32 maxFileSizeOrZero {}; // MB
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs a UTF8 output sink.
|
||
|
* Backed by stdconsole; supports posix fd stdin/out localized, visual studio debugger, and conhost
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewStdSink, IBasicSink);
|
||
|
|
||
|
/**
|
||
|
* @brief Unimplemented systemd or service (?) backend
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewOSEventDirectorySink, IBasicSink);
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs a new sink backed by, syslog or eventlog, by name or event source respectively
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewOSNamedEventDirectorySink, IBasicSink, const AuString &name);
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs a text of binary log file sink
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewFileSink, IBasicSink, const AuString &path, bool binary = false);
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs a dedicated log directory subject to erasure as defined by defined DirectoryLogger
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewDirectorySink, IBasicSink, const AuString &path, DirectoryLogger dirInfo, bool binary = false);
|
||
|
|
||
|
// TODO:
|
||
|
AUKN_SHARED_API(NewIPCSink, IBasicSink, const SocketConsole &console);
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs an in-memory ring buffer sink
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewRingLogger, IBasicSinkRB, AuUInt32 maxLogEntries);
|
||
|
|
||
|
/**
|
||
|
* @brief Constructs a logger object from an array of sinks
|
||
|
*/
|
||
|
AUKN_SHARED_API(NewLogger, ILogger, const AuList<AuSPtr<IBasicSink>> &sinks);
|
||
|
}
|