24#ifndef GCS_LOGGING_INCLUDED
25#define GCS_LOGGING_INCLUDED
133 virtual void log_event(
const char *message,
size_t message_size) = 0;
151 "[MYSQL_GCS_FATAL] ",
"[MYSQL_GCS_ERROR] ",
"[MYSQL_GCS_WARN] ",
152 "[MYSQL_GCS_INFO] "};
178 const std::string &message) = 0;
257#if !defined(GCS_XCOM_DEBUG_INFORMATION)
258#define GCS_XCOM_DEBUG_INFORMATION
285 "GCS_DEBUG_BASIC",
"GCS_DEBUG_TRACE",
"XCOM_DEBUG_BASIC",
286 "XCOM_DEBUG_TRACE",
"GCS_DEBUG_MSG_FLOW",
"XCOM_DEBUG_MSG_FLOW",
287 "GCS_DEBUG_ALL",
"GCS_DEBUG_NONE",
413 int64_t &res_debug_options);
426 std::string &res_debug_options);
This is the interface for the timestamp provider for entries that end up in the Debugger log.
Definition: gcs_logging.h:73
Clock_timestamp_interface()=default
Clock_timestamp_interface & operator=(Clock_timestamp_interface &&other)=delete
Clock_timestamp_interface(Clock_timestamp_interface &&other)=delete
Clock_timestamp_interface(const Clock_timestamp_interface &other)=delete
virtual void get_timestamp_as_c_string(char *buffer, size_t *size)=0
Get the timestamp as c string object.
virtual void get_timestamp_as_string(std::string &str)=0
Get the timestamp as std::string.
Clock_timestamp_interface & operator=(const Clock_timestamp_interface &other)=delete
~Clock_timestamp_interface() override=default
Common interface that is used to define the sink and logger interfaces.
Definition: gcs_logging.h:38
virtual ~Common_interface()=default
Define a virtual destructor as instances of this interface can be polymorphically used.
virtual enum_gcs_error finalize()=0
The purpose of this method is to free any resources used by the objects that implement this interface...
virtual enum_gcs_error initialize()=0
The purpose of this method is to initialize resources used by the objects that implement this interfa...
This class sets up and configures the debugging infrastructure, storing the debugger to be used by th...
Definition: gcs_logging.h:303
static bool force_debug_options(const int64_t debug_options)
Change the current set of debug options by the new debug options expressed as an integer parameter.
Definition: gcs_logging.cc:203
static unsigned int get_number_debug_options()
Get the the number of possible debug options.
Definition: gcs_logging.cc:183
static const std::string m_debug_all
String that represents the GCS_DEBUG_ALL;.
Definition: gcs_logging.h:318
static bool test_debug_options(const int64_t debug_options)
Verify whether any of the debug options are defined.
Definition: gcs_logging.h:355
static std::atomic< std::int64_t > m_debug_options
The debug level enabled which is by default GCS_DEBUG_NONE;.
Definition: gcs_logging.h:308
static bool is_valid_debug_options(const int64_t debug_options)
Check whether the set of debug options is valid or not including GCS_DEBUG_NONE and GCS_DEBUG_ALL.
Definition: gcs_logging.cc:75
static int64_t load_debug_options()
Atomically load information on debug options.
Definition: gcs_logging.h:325
static int64_t get_valid_debug_options()
Get the set of valid debug options excluding GCS_DEBUG_NONE and GCS_DEBUG_ALL.
Definition: gcs_logging.cc:63
static void store_debug_options(int64_t debug_options)
Atomically store information on debug options.
Definition: gcs_logging.h:338
static const std::string m_debug_none
String that represents the GCS_DEBUG_NONE;.
Definition: gcs_logging.h:313
static int64_t get_current_debug_options()
Get the current set of debug options.
Definition: gcs_logging.cc:88
static bool get_debug_options(const std::string &debug_options, int64_t &res_debug_options)
Get the set of debug options passed as parameter as an unsigned integer.
Definition: gcs_logging.cc:134
static bool unset_debug_options(const int64_t debug_options)
Reduce the current set of debug options by disabling the debug options expressed as an integer parame...
Definition: gcs_logging.cc:227
static bool set_debug_options(const int64_t debug_options)
Extend the current set of debug options with new debug options expressed as an integer parameter.
Definition: gcs_logging.cc:187
This class sets up and configures the logging infrastructure, storing the logger to be used by the ap...
Definition: gcs_logging.h:188
static enum_gcs_error finalize()
Free any resource used in the logging system.
Definition: gcs_logging.cc:44
static Logger_interface * m_logger
Definition: gcs_logging.h:190
static Logger_interface * get_logger()
Get a reference to the logger object if there is any.
Definition: gcs_logging.cc:37
static enum_gcs_error initialize(Logger_interface *logger)
Set the logger object and initialize it by invoking its initialization method.
Definition: gcs_logging.cc:39
Logger interface that must be used to define a logger object.
Definition: gcs_logging.h:160
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.
~Logger_interface() override=default
Define a virtual destructor as instances of this interface can be polymorphically used.
Common sink that may be shared by the logging and debugging systems.
Definition: gcs_logging.h:109
virtual void log_event(const char *message, size_t message_size)=0
The purpose of this method is to effectively log the information.
~Sink_interface() override=default
Define a virtual destructor as instances of this interface can be polymorphically used.
virtual const std::string get_information() const =0
The purpose of this method is to return information on the sink such as its location.
virtual void log_event(const std::string &message)=0
The purpose of this method is to effectively log the information.
static const char *const gcs_log_levels[]
Definition: gcs_logging.h:150
static const char *const gcs_xcom_debug_strings[]
Definition: gcs_logging.h:284
gcs_xcom_debug_option_t
Definition: gcs_logging.h:272
@ XCOM_DEBUG_TRACE
Definition: gcs_logging.h:277
@ GCS_DEBUG_TRACE
Definition: gcs_logging.h:275
@ GCS_INVALID_DEBUG
Definition: gcs_logging.h:280
@ GCS_DEBUG_MSG_FLOW
Definition: gcs_logging.h:278
@ GCS_DEBUG_ALL
Definition: gcs_logging.h:281
@ XCOM_DEBUG_MSG_FLOW
Definition: gcs_logging.h:279
@ GCS_DEBUG_BASIC
Definition: gcs_logging.h:274
@ XCOM_DEBUG_BASIC
Definition: gcs_logging.h:276
@ GCS_DEBUG_NONE
Definition: gcs_logging.h:273
gcs_log_level_t
Definition: gcs_logging.h:143
@ GCS_FATAL
Definition: gcs_logging.h:144
@ GCS_ERROR
Definition: gcs_logging.h:145
@ GCS_WARN
Definition: gcs_logging.h:146
@ GCS_INFO
Definition: gcs_logging.h:147
enum_gcs_error
This enumeration describes errors which can occur during group communication operations.
Definition: gcs_types.h:41
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1077
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
static Logger logger
The "top-level" logger used when no connection context is given.
Definition: test_trace_plugin.cc:296