Asynchronous logger class.
More...
#include <async_logger.h>
|
|
using | sink_type = std::function<void(std::string_view)> |
| | Type alias for the sink function.
|
| |
|
|
| async_logger (sink_type sink) |
| |
|
| async_logger (const async_logger &)=delete |
| |
|
async_logger & | operator= (const async_logger &)=delete |
| |
|
| async_logger (async_logger &&)=delete |
| |
|
async_logger & | operator= (async_logger &&)=delete |
| |
| template<typename... FormatArgs> |
| void | log (fmt::format_string< FormatArgs... > fmt_s, FormatArgs &&... args) |
| | Log a formatted message.
|
| |
| void | log_message (std::string msg) |
| | Log a message.
|
| |
|
void | flush () |
| | Flush the logger, blocking until all pending messages are processed.
|
| |
|
void | stop () noexcept |
| | Stop the logger, blocking until all pending messages are processed.
|
| |
| void | set_sink (sink_type sink) |
| | Set the sink function for the logger.
|
| |
Asynchronous logger class.
◆ log()
template<typename... FormatArgs>
| void mazes::async_logger::log |
( |
fmt::format_string< FormatArgs... > | fmt_s, |
|
|
FormatArgs &&... | args ) |
|
inline |
Log a formatted message.
- Template Parameters
-
- Parameters
-
| fmt_s | Format string |
| ...args | Arguments for the format string |
◆ log_message()
| void mazes::async_logger::log_message |
( |
std::string | msg | ) |
|
|
inline |
Log a message.
- Parameters
-
◆ set_sink()
| void mazes::async_logger::set_sink |
( |
sink_type | sink | ) |
|
|
inline |
Set the sink function for the logger.
- Parameters
-
| sink | Sink function to handle log messages |
The documentation for this class was generated from the following file: