CppLogging
1.0.4.0
C++ Logging Library
|
File appender. More...
#include <file_appender.h>
Public Member Functions | |
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. More... | |
FileAppender (const FileAppender &)=delete | |
FileAppender (FileAppender &&)=delete | |
virtual | ~FileAppender () |
FileAppender & | operator= (const FileAppender &)=delete |
FileAppender & | operator= (FileAppender &&)=delete |
bool | IsStarted () const noexcept override |
Is the logging element started? More... | |
bool | Start () override |
Start the logging element. More... | |
bool | Stop () override |
Stop the logging element. More... | |
void | AppendRecord (Record &record) override |
Append the given logging record. More... | |
void | Flush () override |
Flush the logging appender. More... | |
File appender.
File appender writes the given logging record into the file with the given file name. In case of any IO error this appender will lost the logging record, but try to recover from fail in a short interval of 100ms.
Not thread-safe.
Definition at line 29 of file file_appender.h.
|
explicit |
Initialize the appender with a given file, truncate/append and auto-flush flags.
file | - Logging file |
truncate | - Truncate flag (default is false) |
auto_flush | - Auto-flush flag (default is false) |
auto_start | - Auto-start flag (default is true) |
Definition at line 13 of file file_appender.cpp.
|
delete |
|
delete |
|
virtual |
Definition at line 21 of file file_appender.cpp.
|
overridevirtual |
Append the given logging record.
record | - Logging record |
Implements CppLogging::Appender.
Definition at line 48 of file file_appender.cpp.
|
overridevirtual |
Flush the logging appender.
Reimplemented from CppLogging::Appender.
Definition at line 73 of file file_appender.cpp.
|
inlineoverridevirtualnoexcept |
Is the logging element started?
Reimplemented from CppLogging::Element.
Definition at line 48 of file file_appender.h.
|
delete |
|
delete |
|
overridevirtual |
Start the logging element.
Reimplemented from CppLogging::Element.
Definition at line 28 of file file_appender.cpp.
|
overridevirtual |
Stop the logging element.
Reimplemented from CppLogging::Element.
Definition at line 38 of file file_appender.cpp.