MySQL 9.1.0
Source Code Documentation
Gcs_default_logger Class Reference

Default logger which is internally used by GCS and XCOM if nothing else is injected by Group Replication. More...

#include <gcs_logging_system.h>

Inheritance diagram for Gcs_default_logger:
[legend]

Public Member Functions

 Gcs_default_logger (Gcs_async_buffer *sink)
 
 ~Gcs_default_logger () override=default
 
enum_gcs_error initialize () override
 Default logger initialization method. More...
 
enum_gcs_error finalize () override
 Default logger finalization method. More...
 
void log_event (const gcs_log_level_t level, const std::string &message) override
 Asynchronously forwards the received message to a sink. More...
 
- Public Member Functions inherited from Logger_interface
 ~Logger_interface () override=default
 Define a virtual destructor as instances of this interface can be polymorphically used. More...
 
- Public Member Functions inherited from Common_interface
virtual ~Common_interface ()=default
 Define a virtual destructor as instances of this interface can be polymorphically used. More...
 

Private Member Functions

 Gcs_default_logger (Gcs_default_logger &l)
 
Gcs_default_loggeroperator= (const Gcs_default_logger &l)
 

Private Attributes

Gcs_async_bufferm_sink
 Reference to an asynchronous buffer that encapsulates a sink. More...
 

Detailed Description

Default logger which is internally used by GCS and XCOM if nothing else is injected by Group Replication.

Constructor & Destructor Documentation

◆ Gcs_default_logger() [1/2]

Gcs_default_logger::Gcs_default_logger ( Gcs_async_buffer sink)
explicit

◆ ~Gcs_default_logger()

Gcs_default_logger::~Gcs_default_logger ( )
overridedefault

◆ Gcs_default_logger() [2/2]

Gcs_default_logger::Gcs_default_logger ( Gcs_default_logger l)
private

Member Function Documentation

◆ finalize()

enum_gcs_error Gcs_default_logger::finalize ( )
overridevirtual

Default logger finalization method.

Returns
GCS_OK

Implements Common_interface.

◆ initialize()

enum_gcs_error Gcs_default_logger::initialize ( )
overridevirtual

Default logger initialization method.

Returns
GCS_OK

Implements Common_interface.

◆ log_event()

void Gcs_default_logger::log_event ( const gcs_log_level_t  level,
const std::string &  message 
)
overridevirtual

Asynchronously forwards the received message to a sink.

This method prepares the message and writes it to an in-memory buffer. If there is no free entry in the in-memory buffer, the call blocks until an entry becomes available.

Note that the write to the sink is done asynchronously.

This method shouldn't be invoked directly in the code, as it is wrapped by the MYSQL_GCS_LOG_[LEVEL] macros which deal with the rendering of the logging message into a final string that is then handed alongside with the level to this method.

Parameters
levellogging level of the message
messagerendered string of the logging message

Implements Logger_interface.

◆ operator=()

Gcs_default_logger & Gcs_default_logger::operator= ( const Gcs_default_logger l)
private

Member Data Documentation

◆ m_sink

Gcs_async_buffer* Gcs_default_logger::m_sink
private

Reference to an asynchronous buffer that encapsulates a sink.


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