MySQL 8.3.0
Source Code Documentation
registry.cc File Reference
#include <algorithm>
#include <array>
#include <chrono>
#include <cstdarg>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "my_compiler.h"
#include "mysql/harness/config_parser.h"
#include "mysql/harness/logging/handler.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/logging/registry.h"
#include "mysql/harness/stdx/process.h"
#include "common.h"
#include "dim.h"

Namespaces

namespace  anonymous_namespace{registry.cc}
 
namespace  mysql_harness
 
namespace  mysql_harness::logging
 

Macros

#define harness_assert(COND)    if (!(COND)) abort();
 

Functions

HARNESS_EXPORT void mysql_harness::logging::attach_handler_to_all_loggers (Registry &registry, std::string name)
 Attach handler to all loggers. More...
 
HARNESS_EXPORT void mysql_harness::logging::set_log_level_for_all_loggers (Registry &registry, LogLevel level)
 Set log levels for all the loggers to specified value. More...
 
HARNESS_EXPORT void mysql_harness::logging::set_log_level_for_all_handlers (const Registry &registry, LogLevel level)
 Set log levels for all handlers to specified value. More...
 
HARNESS_EXPORT void mysql_harness::logging::set_timestamp_precision_for_all_loggers (Registry &registry, LogTimestampPrecision precision)
 Set timestamp precision for all the loggers. More...
 
HARNESS_EXPORT void mysql_harness::logging::clear_registry (Registry &registry)
 Clear registry. More...
 
HARNESS_EXPORT std::ostream * mysql_harness::logging::get_default_logger_stream ()
 Returns pointer to the default logger sink stream. More...
 
HARNESS_EXPORT void mysql_harness::logging::create_main_log_handler (Registry &registry, const std::string &program, const std::string &logging_folder, bool format_messages, bool use_os_log=false)
 Initialize logfile handler. More...
 
HARNESS_EXPORT void mysql_harness::logging::create_logger (Registry &registry, const LogLevel level, const std::string &logger_name)
 
HARNESS_EXPORT void mysql_harness::logging::create_module_loggers (Registry &registry, const LogLevel level, const std::list< std::string > &modules, const std::string &main_app_log_domain)
 Initialize logging facility. More...
 
HARNESS_EXPORT LogLevel mysql_harness::logging::log_level_from_string (std::string name)
 Converts string with log level description to LogLevel type. More...
 
HARNESS_EXPORT LogLevel mysql_harness::logging::get_default_log_level (const Config &config, bool raw_mode=false)
 Get default log level. More...
 
HARNESS_EXPORT std::string mysql_harness::logging::get_default_log_filename (const Config &config)
 Get default log filename. More...
 
HARNESS_EXPORT LogTimestampPrecision mysql_harness::logging::log_timestamp_precision_from_string (std::string name)
 Converts string with log timestamp precision description to LogTimestampPrecision type. More...
 
HARNESS_EXPORT LogTimestampPrecision mysql_harness::logging::get_default_timestamp_precision (const Config &config)
 Get default timestamp precision. More...
 
HARNESS_EXPORT void mysql_harness::logging::register_handler (std::string name, std::shared_ptr< Handler > handler)
 Register handler for all plugins. More...
 
HARNESS_EXPORT void mysql_harness::logging::unregister_handler (std::string name)
 Unregister a handler. More...
 
HARNESS_EXPORT void mysql_harness::logging::set_log_level_for_all_loggers (LogLevel level)
 Set log level for all registered loggers. More...
 
HARNESS_EXPORT void mysql_harness::logging::set_log_level_for_all_handlers (LogLevel level)
 Set log level for all registered handlers. More...
 
HARNESS_EXPORT bool mysql_harness::logging::log_level_is_handled (LogLevel level, const char *domain)
 
void mysql_harness::logging::set_timestamp_precision_for_all_loggers (LogTimestampPrecision precision)
 
void HARNESS_EXPORT log_message (LogLevel level, const char *module, const char *fmt, va_list ap)
 

Variables

constexpr const std::array< std::pair< std::string_view, LogLevel >, 7 > anonymous_namespace{registry.cc}::kLogLevels
 
constexpr const std::array< std::pair< std::string_view, LogTimestampPrecision >, 12 > anonymous_namespace{registry.cc}::kLogTimestampPrecisions
 
static std::string mysql_harness::logging::g_main_app_log_domain
 

Macro Definition Documentation

◆ harness_assert

#define harness_assert (   COND)     if (!(COND)) abort();

Function Documentation

◆ log_message()

void log_message ( LogLevel  level,
const char *  module,
const char *  fmt,
va_list  ap 
)