MySQL 8.0.31
Source Code Documentation
logger_plugin.cc File Reference

Namespaces

namespace  anonymous_namespace{logger_plugin.cc}
 

Macros

#define MYSQL_ROUTER_LOG_DOMAIN   "logger"
 
#define NULL_DEVICE_NAME   "/dev/null"
 
#define STDOUT_DEVICE_NAME   "/dev/stdout"
 
#define STDERR_DEVICE_NAME   "/dev/stderr"
 
#define LEGAL_DESTINATION_DEVICE_NAMES    NULL_DEVICE_NAME ", " STDOUT_DEVICE_NAME ", " STDERR_DEVICE_NAME
 

Typedefs

using HandlerPtr = std::shared_ptr< mysql_harness::logging::Handler >
 
using LoggerHandlersList = std::vector< std::pair< std::string, HandlerPtr > >
 

Functions

static bool legal_consolelog_destination (const std::string &destination)
 
HandlerPtr anonymous_namespace{logger_plugin.cc}::create_logging_sink (const std::string &sink_name, const mysql_harness::LoaderConfig &config, const std::string &default_log_filename, const mysql_harness::logging::LogLevel default_log_level, const mysql_harness::logging::LogTimestampPrecision default_log_timestamp_precision)
 
void create_plugin_loggers (const mysql_harness::LoaderConfig &config, mysql_harness::logging::Registry &registry, const mysql_harness::logging::LogLevel level)
 Creates the logging handler for each plugin from the configuration. More...
 
static bool init_handlers (mysql_harness::PluginFuncEnv *env, const mysql_harness::LoaderConfig &config, LoggerHandlersList &logger_handlers)
 
static void switch_to_loggers_in_config (const mysql_harness::LoaderConfig &config, const LoggerHandlersList &logger_handlers)
 
static void init (mysql_harness::PluginFuncEnv *env)
 

Variables

mysql_harness::Plugin harness_plugin_logger
 

Macro Definition Documentation

◆ LEGAL_DESTINATION_DEVICE_NAMES

#define LEGAL_DESTINATION_DEVICE_NAMES    NULL_DEVICE_NAME ", " STDOUT_DEVICE_NAME ", " STDERR_DEVICE_NAME

◆ MYSQL_ROUTER_LOG_DOMAIN

#define MYSQL_ROUTER_LOG_DOMAIN   "logger"

◆ NULL_DEVICE_NAME

#define NULL_DEVICE_NAME   "/dev/null"

◆ STDERR_DEVICE_NAME

#define STDERR_DEVICE_NAME   "/dev/stderr"

◆ STDOUT_DEVICE_NAME

#define STDOUT_DEVICE_NAME   "/dev/stdout"

Typedef Documentation

◆ HandlerPtr

using HandlerPtr = std::shared_ptr<mysql_harness::logging::Handler>

◆ LoggerHandlersList

using LoggerHandlersList = std::vector<std::pair<std::string, HandlerPtr> >

Function Documentation

◆ create_plugin_loggers()

void create_plugin_loggers ( const mysql_harness::LoaderConfig config,
mysql_harness::logging::Registry registry,
const mysql_harness::logging::LogLevel  level 
)

Creates the logging handler for each plugin from the configuration.

Parameters
configconfiguration containing the plugin names we should create loggers for
registrylogging registry where the logging handlers should be created
levellogging level for the newly create logging handlers
Exceptions
std::logic_error

◆ init()

static void init ( mysql_harness::PluginFuncEnv env)
static

◆ init_handlers()

static bool init_handlers ( mysql_harness::PluginFuncEnv env,
const mysql_harness::LoaderConfig config,
LoggerHandlersList logger_handlers 
)
static

◆ legal_consolelog_destination()

static bool legal_consolelog_destination ( const std::string &  destination)
inlinestatic

◆ switch_to_loggers_in_config()

static void switch_to_loggers_in_config ( const mysql_harness::LoaderConfig config,
const LoggerHandlersList logger_handlers 
)
static

Variable Documentation

◆ harness_plugin_logger

mysql_harness::Plugin harness_plugin_logger
Initial value:
= {
mysql_harness::PLUGIN_ABI_VERSION,
mysql_harness::ARCHITECTURE_DESCRIPTOR,
"Logger",
VERSION_NUMBER(0, 0, 1),
0,
nullptr,
0,
nullptr,
init,
nullptr,
nullptr,
nullptr,
false,
}
static void init(mysql_harness::PluginFuncEnv *env)
Definition: logger_plugin.cc:413
static constexpr std::array< const char *, 5 > logger_supported_options
Definition: supported_logger_options.h:38