MySQL 9.1.0
Source Code Documentation
logger_plugin.h File Reference
#include <array>
#include <functional>
#include "harness_export.h"
#include "mysql/harness/loader_config.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/logging/registry.h"
#include "mysql/harness/plugin.h"

Go to the source code of this file.

Typedefs

using on_switch_to_configured_loggers = std::function< void()>
 

Functions

void HARNESS_EXPORT 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...
 
void HARNESS_EXPORT register_on_switch_to_configured_loggers_callback (on_switch_to_configured_loggers callback)
 Registers the callback that the plugin will execute once it is finished with initialization and switches from the default to the configured logger sink(s). More...
 

Variables

constexpr const char * kLoggerPluginName = "logger"
 
mysql_harness::Plugin HARNESS_EXPORT harness_plugin_logger
 

Typedef Documentation

◆ on_switch_to_configured_loggers

using on_switch_to_configured_loggers = std::function<void()>

Function Documentation

◆ create_plugin_loggers()

void HARNESS_EXPORT 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

◆ register_on_switch_to_configured_loggers_callback()

void HARNESS_EXPORT register_on_switch_to_configured_loggers_callback ( on_switch_to_configured_loggers  callback)

Registers the callback that the plugin will execute once it is finished with initialization and switches from the default to the configured logger sink(s).

Parameters
callbackcallback to execute

Variable Documentation

◆ harness_plugin_logger

mysql_harness::Plugin HARNESS_EXPORT harness_plugin_logger
extern

◆ kLoggerPluginName

constexpr const char* kLoggerPluginName = "logger"
constexpr