ASIO Client Server Framework
Loading...
Searching...
No Matches
acsf::Logger Class Reference

Writes log entries to rotating files in the background. Used internally by Server and Client. More...

#include <logger.h>

Public Member Functions

 Logger (boost::asio::io_context &ioc, LoggerConfig config={})
 Creates a logger. If config.enabled is false it does nothing.
void unsafeFlushNow ()
 Writes all buffered entries to disk immediately on the calling thread. Only safe when no other thread is logging.
void flush ()
 Asks the logger to write buffered entries to disk. Returns immediately.
void push (Log log)
 Adds an entry to the log. Returns immediately. Ignored when logging is disabled.

Detailed Description

Writes log entries to rotating files in the background. Used internally by Server and Client.

Constructor & Destructor Documentation

◆ Logger()

acsf::Logger::Logger ( boost::asio::io_context & ioc,
LoggerConfig config = {} )
inline

Creates a logger. If config.enabled is false it does nothing.

Parameters
iocI/O context the logger runs on.
configLogging settings.

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