9 #ifndef CPPLOGGING_APPENDERS_FILE_APPENDER_H
10 #define CPPLOGGING_APPENDERS_FILE_APPENDER_H
14 #include "filesystem/filesystem.h"
39 explicit FileAppender(
const CppCommon::Path& file,
bool truncate =
false,
bool auto_flush =
false,
bool auto_start =
true);
48 bool IsStarted() const noexcept
override {
return _started; }
49 bool Start()
override;
52 void Flush()
override;
55 std::atomic<bool> _started{
false};
56 CppCommon::Timestamp _retry{0};
57 CppCommon::File _file;
Logging appender interface definition.
Logging appender interface.
bool IsStarted() const noexcept override
Is the logging element started?
FileAppender & operator=(FileAppender &&)=delete
bool Start() override
Start the logging element.
FileAppender & operator=(const FileAppender &)=delete
FileAppender(FileAppender &&)=delete
FileAppender(const FileAppender &)=delete
void AppendRecord(Record &record) override
Append the given logging record.
void Flush() override
Flush the logging appender.
bool Stop() override
Stop the logging element.
FileAppender(const CppCommon::Path &file, bool truncate=false, bool auto_flush=false, bool auto_start=true)
Initialize the appender with a given file, truncate/append and auto-flush flags.
C++ Logging project definitions.