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

Base interface for logging UCI protocol messages. More...

#include <Logger.h>

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

Public Types

enum  MessageDirection { ToEngine , FromEngine , FromParser }
 Enumeration of message directions for logging purposes. More...
 

Public Member Functions

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.
 

Detailed Description

Base interface for logging UCI protocol messages.

Provides an abstract interface for capturing messages exchanged with a chess engine via the UCI protocol. The Logger is responsible for recording messages sent to the engine, received from the engine, or generated by the parser.

This is the core logging interface that all concrete loggers must inherit from. Concrete implementations include file loggers, stream loggers, buffer loggers, and callback-based loggers. Loggers can be customized using LoggerTraits to add behavior such as timestamp formatting or filtering specific message types.

See also
LoggerTrait for customizing logger behavior
LoggerBuilder for creating and composing loggers
Loggers namespace for factory functions

Member Enumeration Documentation

◆ MessageDirection

Enumeration of message directions for logging purposes.

Enumerator
ToEngine 

Message sent from the application to the chess engine.

FromEngine 

Message received from the chess engine.

FromParser 

Message generated or parsed by the UCI parser.

Member Function Documentation

◆ log()

virtual void UCILoader::Logger::log ( MessageDirection  dir,
const std::string &  msg 
)
pure virtual

Log a message with a specified direction.

Parameters
dirThe direction of the message (sent to engine, received from engine, or parsed)
msgThe message content to be logged

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