MySQL 8.0.39
Source Code Documentation
gcs_logging_system.h File Reference
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
#include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_logging.h"
#include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_psi.h"
#include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/xplatform/my_xp_thread.h"
#include "my_sys.h"

Go to the source code of this file.

Classes

class  Gcs_log_event
 Entry or element in the circular buffer maintained by the Gcs_async_buffer responsible for storing a message that will eventually be asynchronously written to a sink. More...
 
class  Gcs_async_buffer
 Circular buffer that can be used to asynchronously feed a sink. More...
 
class  Gcs_output_sink
 Standard output sink. More...
 
class  Gcs_default_logger
 Default logger which is internally used by GCS and XCOM if nothing else is injected by Group Replication. More...
 
class  Gcs_default_debugger
 Default debugger which is used only by GCS and XCOM. More...
 
class  Gcs_debug_manager
 This class sets up and configures the debugging infrastructure, storing the debugger to be used by the application as a singleton. More...
 
class  Gcs_file_sink
 

Macros

#define GCS_MAX_LOG_BUFFER   512
 Maximum size of a message stored in a single entry in the circular buffer. More...
 
#define DEFAULT_ASYNC_BUFFERS   4096
 Default number of circular buffer entries. More...
 
#define GCS_PREFIX   "[GCS] "
 
#define GCS_PREFIX_SIZE   6
 
#define GCS_DEBUG_PREFIX   "[MYSQL_GCS_DEBUG] "
 
#define GCS_DEBUG_PREFIX_SIZE   18
 
#define GCS_NEWLINE   "\n"
 
#define GCS_NEWLINE_SIZE   1
 
#define MYSQL_GCS_LOG(l, x)
 
#define MYSQL_GCS_LOG_INFO(x)   MYSQL_GCS_LOG(GCS_INFO, x)
 
#define MYSQL_GCS_LOG_WARN(x)   MYSQL_GCS_LOG(GCS_WARN, x)
 
#define MYSQL_GCS_LOG_ERROR(x)   MYSQL_GCS_LOG(GCS_ERROR, x)
 
#define MYSQL_GCS_LOG_FATAL(x)   MYSQL_GCS_LOG(GCS_FATAL, x)
 
#define MYSQL_GCS_DEBUG_EXECUTE(x)    MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION(GCS_DEBUG_BASIC | GCS_DEBUG_TRACE, x)
 
#define MYSQL_GCS_TRACE_EXECUTE(x)    MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION(GCS_DEBUG_TRACE, x)
 
#define MYSQL_GCS_LOG_DEBUG(...)
 
#define MYSQL_GCS_LOG_TRACE(...)    MYSQL_GCS_LOG_DEBUG_WITH_OPTION(GCS_DEBUG_TRACE, __VA_ARGS__)
 
#define MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION(option, x)
 
#define MYSQL_GCS_LOG_DEBUG_WITH_OPTION(options, ...)
 

Macro Definition Documentation

◆ DEFAULT_ASYNC_BUFFERS

#define DEFAULT_ASYNC_BUFFERS   4096

Default number of circular buffer entries.

◆ GCS_DEBUG_PREFIX

#define GCS_DEBUG_PREFIX   "[MYSQL_GCS_DEBUG] "

◆ GCS_DEBUG_PREFIX_SIZE

#define GCS_DEBUG_PREFIX_SIZE   18

◆ GCS_MAX_LOG_BUFFER

#define GCS_MAX_LOG_BUFFER   512

Maximum size of a message stored in a single entry in the circular buffer.

◆ GCS_NEWLINE

#define GCS_NEWLINE   "\n"

◆ GCS_NEWLINE_SIZE

#define GCS_NEWLINE_SIZE   1

◆ GCS_PREFIX

#define GCS_PREFIX   "[GCS] "

◆ GCS_PREFIX_SIZE

#define GCS_PREFIX_SIZE   6

◆ MYSQL_GCS_DEBUG_EXECUTE

#define MYSQL_GCS_DEBUG_EXECUTE (   x)     MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION(GCS_DEBUG_BASIC | GCS_DEBUG_TRACE, x)

◆ MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION

#define MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION (   option,
 
)
Value:
do { \
x; \
} \
} while (0);
static bool test_debug_options(const int64_t debug_options)
Verify whether any of the debug options are defined.
Definition: gcs_logging.h:320

◆ MYSQL_GCS_LOG

#define MYSQL_GCS_LOG (   l,
 
)
Value:
do { \
std::stringstream log; \
log << GCS_PREFIX << x; \
} \
} while (0);
static Logger_interface * get_logger()
Get a reference to the logger object if there is any.
Definition: gcs_logging.cc:37
virtual void log_event(const gcs_log_level_t level, const std::string &message)=0
The purpose of this method is to deliver to the logging system any message to be logged.
#define GCS_PREFIX
Definition: gcs_logging_system.h:59
#define NULL
Definition: types.h:55

◆ MYSQL_GCS_LOG_DEBUG

#define MYSQL_GCS_LOG_DEBUG (   ...)
Value:
__VA_ARGS__)
@ GCS_DEBUG_TRACE
Definition: gcs_logging.h:240
@ GCS_DEBUG_BASIC
Definition: gcs_logging.h:239
#define MYSQL_GCS_LOG_DEBUG_WITH_OPTION(options,...)
Definition: gcs_logging_system.h:868

◆ MYSQL_GCS_LOG_DEBUG_WITH_OPTION

#define MYSQL_GCS_LOG_DEBUG_WITH_OPTION (   options,
  ... 
)
Value:
do { \
Gcs_default_debugger *debugger = Gcs_debug_manager::get_debugger(); \
debugger->log_event(options, __VA_ARGS__); \
} while (0);
static Gcs_default_debugger * get_debugger()
Get a reference to the debugger object if there is any.
Definition: gcs_logging_system.h:723
Definition: options.cc:49

◆ MYSQL_GCS_LOG_ERROR

#define MYSQL_GCS_LOG_ERROR (   x)    MYSQL_GCS_LOG(GCS_ERROR, x)

◆ MYSQL_GCS_LOG_FATAL

#define MYSQL_GCS_LOG_FATAL (   x)    MYSQL_GCS_LOG(GCS_FATAL, x)

◆ MYSQL_GCS_LOG_INFO

#define MYSQL_GCS_LOG_INFO (   x)    MYSQL_GCS_LOG(GCS_INFO, x)

◆ MYSQL_GCS_LOG_TRACE

#define MYSQL_GCS_LOG_TRACE (   ...)     MYSQL_GCS_LOG_DEBUG_WITH_OPTION(GCS_DEBUG_TRACE, __VA_ARGS__)

◆ MYSQL_GCS_LOG_WARN

#define MYSQL_GCS_LOG_WARN (   x)    MYSQL_GCS_LOG(GCS_WARN, x)

◆ MYSQL_GCS_TRACE_EXECUTE

#define MYSQL_GCS_TRACE_EXECUTE (   x)     MYSQL_GCS_DEBUG_EXECUTE_WITH_OPTION(GCS_DEBUG_TRACE, x)