Log file writer. More...
#include <fileWriter.hpp>
Public Member Functions | |
| FileWriter (const anch::conf::Section &conf) | |
| virtual | ~FileWriter () |
| virtual void | write (const std::string &message) |
| Public Member Functions inherited from anch::log::Writer | |
| Writer (const anch::conf::Section &conf) | |
| virtual | ~Writer () |
Protected Member Functions | |
| bool | rotate () const |
| void | rotateFiles () |
| Protected Member Functions inherited from anch::log::Writer | |
| std::string | format (const std::string &msg) |
Protected Attributes | |
| std::ofstream * | _output |
| std::filesystem::path | _path |
| uint32_t | _maxSize |
| int | _maxIdx |
| int | _fileIdx |
Log file writer.
Manage file writer with file rotation on size, date and max rotate index
| anch::log::FileWriter::FileWriter | ( | const anch::conf::Section & | conf | ) |
FileWriter constructor
| conf | the writer's configuration |
|
virtual |
FileWriter destructor
|
protected |
Check if file has to be rotate according to configuration and its size
|
protected |
Rotate files when current reachs the maximum file length.
|
virtual |
Write message in the file.
Rotate log file when needed.
| message | Message to write |
Implements anch::log::Writer.
Reimplemented in anch::log::LowPriorityWriter, and anch::log::ThreadSafeWriter.
|
protected |
Current file index
|
protected |
Maximum file index
|
protected |
Maximum file size
|
protected |
Ouput file stream
|
protected |
File name