UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
Loading...
Searching...
No Matches
UCILoader::LoggerWrapper Class Reference

Base class for loggers that wrap and delegate to another logger. More...

#include <Logger.h>

Inheritance diagram for UCILoader::LoggerWrapper:
UCILoader::Logger

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LoggerWrapper()

UCILoader::LoggerWrapper::LoggerWrapper ( std::unique_ptr< Logger > &&  logger)

Construct a LoggerWrapper with a logger to wrap.

Parameters
loggerThe logger to wrap and delegate to

Member Function Documentation

◆ delegate()

void UCILoader::LoggerWrapper::delegate ( MessageDirection  dir,
const std::string &  msg 
)
protected

Delegate a log message to the wrapped logger.

Parameters
dirThe message direction
msgThe message to log

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