|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Base class for loggers that wrap and delegate to another logger. More...
#include <Logger.h>
Public Member Functions | |
| LoggerWrapper (std::unique_ptr< Logger > &&logger) | |
| Construct a LoggerWrapper with a logger to wrap. | |
Public Member Functions inherited from UCILoader::Logger | |
| virtual | ~Logger ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual void | log (MessageDirection dir, const std::string &msg)=0 |
| Log a message with a specified direction. | |
Protected Member Functions | |
| void | delegate (MessageDirection dir, const std::string &msg) |
| Delegate a log message to the wrapped logger. | |
Additional Inherited Members | |
Public Types inherited from UCILoader::Logger | |
| enum | MessageDirection { ToEngine , FromEngine , FromParser } |
| Enumeration of message directions for logging purposes. More... | |
Base class for loggers that wrap and delegate to another logger.
This class provides a foundation for implementing the decorator pattern, allowing composition of loggers and traits. Derived classes can intercept, modify, or enhance logging behavior before delegating to the wrapped logger.
| UCILoader::LoggerWrapper::LoggerWrapper | ( | std::unique_ptr< Logger > && | logger | ) |
Construct a LoggerWrapper with a logger to wrap.
| logger | The logger to wrap and delegate to |
|
protected |
Delegate a log message to the wrapped logger.
| dir | The message direction |
| msg | The message to log |