AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::log::LowPriorityWriter Class Reference

#include <lowPriorityWriter.hpp>

Inheritance diagram for anch::log::LowPriorityWriter:
Collaboration diagram for anch::log::LowPriorityWriter:

Public Member Functions

 LowPriorityWriter (const anch::conf::Section &conf)
virtual ~LowPriorityWriter ()
virtual void write (const std::string &message) override
void startTreatment ()
Public Member Functions inherited from anch::log::FileWriter
 FileWriter (const anch::conf::Section &conf)
virtual ~FileWriter ()
Public Member Functions inherited from anch::log::Writer
 Writer (const anch::conf::Section &conf)
virtual ~Writer ()

Additional Inherited Members

Protected Member Functions inherited from anch::log::FileWriter
void writeLine (const std::string &line)
bool rotate ()
void rotateFiles ()
std::filesystem::path archive (std::uint32_t index) const
Protected Member Functions inherited from anch::log::Writer
std::string format (const std::string &msg)
Protected Attributes inherited from anch::log::FileWriter
std::ofstream _output
std::filesystem::path _path
std::uint64_t _maxSize
std::uint32_t _maxFiles

Detailed Description

File writer with QoS implementation to avoid performance lose when files are written.
Messages are formatted in the logging thread and written by a dedicated thread. The queued messages are written before destruction.

Author
Vincent Lachenal

Constructor & Destructor Documentation

◆ LowPriorityWriter()

anch::log::LowPriorityWriter::LowPriorityWriter ( const anch::conf::Section & conf)

LowPriorityWriter constructor.
Start the writing thread.

Parameters
confthe writer's configuration

◆ ~LowPriorityWriter()

virtual anch::log::LowPriorityWriter::~LowPriorityWriter ( )
virtual

LowPriorityWriter destructor.
Write the queued messages and stop the writing thread.

Member Function Documentation

◆ startTreatment()

void anch::log::LowPriorityWriter::startTreatment ( )

Start messages queue pooling.
The writing thread is started by the constructor: this method does nothing when it is running.

◆ write()

virtual void anch::log::LowPriorityWriter::write ( const std::string & message)
overridevirtual

Queue message to write in the file.

Parameters
messageMessage to write

Reimplemented from anch::log::FileWriter.


The documentation for this class was generated from the following file: