31#ifndef MYSQL_HARNESS_LOGGING_INCLUDED
32#define MYSQL_HARNESS_LOGGING_INCLUDED
34#include "harness_export.h"
185 std::chrono::time_point<std::chrono::system_clock>
created;
214#ifndef MYSQL_ROUTER_LOG_DOMAIN
215#define MYSQL_ROUTER_LOG_DOMAIN ""
222static inline void log_system(
const char *fmt, ...)
224static inline
void log_error(const
char *fmt, ...)
226static inline
void log_warning(const
char *fmt, ...)
228static inline
void log_info(const
char *fmt, ...)
230static inline
void log_note(const
char *fmt, ...)
232static inline
void log_debug(const
char *fmt, ...)
243 const char *fmt, va_list ap);
252 const char *fmt, va_list ap);
261 const char *fmt, va_list ap);
270 const char *fmt, va_list ap);
279 const char *fmt, va_list ap);
288 const char *fmt, va_list ap);
297 const char *fmt, va_list ap);
323#define IMPORT_LOG_FUNCTIONS() \
324 using mysql_harness::logging::log_system; \
325 using mysql_harness::logging::log_error; \
326 using mysql_harness::logging::log_warning; \
327 using mysql_harness::logging::log_info; \
328 using mysql_harness::logging::log_note; \
329 using mysql_harness::logging::log_debug; \
330 using mysql_harness::logging::log_custom;
#define ATTRIBUTE_GCC_FORMAT(style, fmt_pos, arg_pos)
Definition: compiler_attributes.h:33
#define MYSQL_ROUTER_LOG_DOMAIN
Log message for the domain.
Definition: logging.h:215
static loglevel log_level(const Sql_condition *condition)
Definition: histogram.cc:1643
constexpr char kSinks[]
Definition: logging.h:65
constexpr char kDestination[]
Definition: logging.h:62
constexpr char kLevel[]
Definition: logging.h:63
constexpr char kTimestampPrecision[]
Definition: logging.h:64
constexpr char kFilename[]
Definition: logging.h:61
const size_t kLogMessageMaxSize
Max message length that can be logged; if message is longer, it will be truncated to this length.
Definition: logging.h:54
const char *const kDefaultLogLevelName
Log level name for the default log level used by the router.
Definition: logging.h:150
constexpr char kDefaultLogFilename[]
Default log filename.
Definition: logging.h:83
constexpr char kSqlLogger[]
Definition: logging.h:79
const LogLevel kDefaultLogLevel
Default log level used by the router.
Definition: logging.h:140
LogLevel
Log level values.
Definition: logging.h:90
@ kInfo
Informational message.
@ kWarning
Warning message.
@ kNote
Note level contains additional information over the normal informational messages.
constexpr char kMainLogger[]
Special names reserved for "main" program logger.
Definition: logging.h:75
constexpr char kNone[]
Definition: logging.h:70
static void static void static void static void static void static void static void log_custom(const LogLevel log_level, const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:295
static void static void log_error(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:250
constexpr char kMainConsoleHandler[]
Definition: logging.h:77
static void static void static void static void static void log_note(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:277
const char *const kRawLogLevelName
Log level name used in raw logging mode.
Definition: logging.h:155
static void log_system(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:241
static void static void static void static void log_info(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:268
static void static void static void static void static void static void log_debug(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:286
const LogLevel kDefaultLogLevelBootstrap
Default log level written by the router to the config file on bootstrap.
Definition: logging.h:145
static void static void static void log_warning(const char *fmt,...) ATTRIBUTE_GCC_FORMAT(printf
Definition: logging.h:259
LogTimestampPrecision
Log timestamp precision values.
Definition: logging.h:160
constexpr char kMainLogHandler[]
Definition: logging.h:76
constexpr char kConfigSectionLogger[]
Definition: logging.h:68
HARNESS_EXPORT bool log_level_is_handled(LogLevel level, const char *domain)
Definition: registry.cc:508
Definition: options.cc:57
pid_t pid_type
Definition: process.h:45
void HARNESS_EXPORT log_message(LogLevel level, const char *module, const char *fmt, va_list ap)
Definition: registry.cc:549
Log record containing information collected by the logging system.
Definition: logging.h:182
stdx::this_process::pid_type process_id
Definition: logging.h:184
LogLevel level
Definition: logging.h:183
std::string message
Definition: logging.h:187
std::string domain
Definition: logging.h:186
std::chrono::time_point< std::chrono::system_clock > created
Definition: logging.h:185