MySQL 8.0.39
Source Code Documentation
log_builtins.h File Reference

Go to the source code of this file.

Classes

struct  s_mysql_log_builtins
 Primitives for services to interact with the structured logger: functions pertaining to log_line and log_item data. More...
 
struct  s_mysql_log_builtins_string
 String primitives for logging services. More...
 
struct  s_mysql_log_builtins_tmp
 Temporary primitives for logging services. More...
 
struct  s_mysql_log_builtins_syseventlog
 Syslog/Eventlog functions for logging services. More...
 
class  LogEvent
 Modular logger: fluid API. More...
 

Macros

#define log_line_init   log_bi->line_init
 
#define log_line_exit   log_bi->line_exit
 
#define log_line_item_set_with_key   log_bi->line_item_set_with_key
 
#define log_line_item_set   log_bi->line_item_set
 
#define log_line_item_types_seen   log_bi->line_item_types_seen
 
#define log_line_submit   log_bi->line_submit
 
#define log_set_int   log_bi->item_set_int
 
#define log_set_float   log_bi->item_set_float
 
#define log_set_lexstring   log_bi->item_set_lexstring
 
#define log_set_cstring   log_bi->item_set_cstring
 
#define log_malloc   log_bs->malloc
 
#define log_free   log_bs->free
 
#define log_msg   log_bs->substitutev
 
#define error_msg_by_errcode   log_bi->errmsg_by_errcode
 
#define error_code_by_errsymbol   log_bi->errcode_by_errsymbol
 
#define LogErr(severity, ecode, ...)
 

Typedefs

typedef bool(* log_line_processor) (log_line *ll)
 This defines built-in functions for use by logging services. More...
 
typedef struct s_mysql_log_builtins mysql_service_log_builtins_t
 Primitives for services to interact with the structured logger: functions pertaining to log_line and log_item data. More...
 
typedef struct s_mysql_log_builtins_string mysql_service_log_builtins_string_t
 String primitives for logging services. More...
 
typedef struct s_mysql_log_builtins_tmp mysql_service_log_builtins_tmp_t
 Temporary primitives for logging services. More...
 
typedef struct s_mysql_log_builtins_syseventlog mysql_service_log_builtins_syseventlog_t
 Syslog/Eventlog functions for logging services. More...
 

Functions

void log_line_process_hook_set (log_line_processor llp)
 Set the log-event processor. More...
 
log_line_processor log_line_process_hook_get (void)
 Get current log-event processor. More...
 

Variables

const mysql_service_log_builtins_tlog_bi
 accessor built-ins More...
 
const mysql_service_log_builtins_string_tlog_bs
 string built-ins More...
 

Macro Definition Documentation

◆ error_code_by_errsymbol

#define error_code_by_errsymbol   log_bi->errcode_by_errsymbol

◆ error_msg_by_errcode

#define error_msg_by_errcode   log_bi->errmsg_by_errcode

◆ log_free

#define log_free   log_bs->free

◆ log_line_exit

#define log_line_exit   log_bi->line_exit

◆ log_line_init

#define log_line_init   log_bi->line_init

◆ log_line_item_set

#define log_line_item_set   log_bi->line_item_set

◆ log_line_item_set_with_key

#define log_line_item_set_with_key   log_bi->line_item_set_with_key

◆ log_line_item_types_seen

#define log_line_item_types_seen   log_bi->line_item_types_seen

◆ log_line_submit

#define log_line_submit   log_bi->line_submit

◆ log_malloc

#define log_malloc   log_bs->malloc

◆ log_msg

#define log_msg   log_bs->substitutev

◆ log_set_cstring

#define log_set_cstring   log_bi->item_set_cstring

◆ log_set_float

#define log_set_float   log_bi->item_set_float

◆ log_set_int

#define log_set_int   log_bi->item_set_int

◆ log_set_lexstring

#define log_set_lexstring   log_bi->item_set_lexstring

◆ LogErr

#define LogErr (   severity,
  ecode,
  ... 
)
Value:
.prio(severity) \
.errcode(ecode) \
.source_line(__LINE__) \
.function(__FUNCTION__) \
.lookup(ecode, ##__VA_ARGS__)
Modular logger: fluid API.
Definition: log_builtins.h:881
LogEvent & prio(longlong val)
Set error message priority.
Definition: log_builtins.h:1273
LogEvent & subsys(const char *val)
Which subsystem in the source was the problem detected in? ("Repl"/"InnoDB"/"Server")
Definition: log_builtins.h:1148
LogEvent & errcode(longlong val)
Append a numeric error code.
Definition: log_builtins.h:1050
LogEvent & source_file(const char *val)
Which source file was the problem detected in?
Definition: log_builtins.h:1111
LogEvent & function(const char *val)
Which function in the source was the problem detected in?
Definition: log_builtins.h:1135
LogEvent & source_line(longlong val)
Which line in the source file was the problem detected on?
Definition: log_builtins.h:1123
LogEvent & lookup(longlong errcode,...)
Find an error message by its MySQL error code.
Definition: log_builtins.h:1390
#define LOG_SUBSYSTEM_TAG
Definition: log_sink_test.cc:27
#define MY_BASENAME
Definition: my_basename.h:40

Typedef Documentation

◆ log_line_processor

typedef bool(* log_line_processor) (log_line *ll)

This defines built-in functions for use by logging services.

These helpers are organized into a number of APIs grouping related functionality.

For documentation of the individual functions, see log_builtins.cc typedef for log-processing functions ("buffer this event", "process this event", etc.)

◆ mysql_service_log_builtins_string_t

String primitives for logging services.

◆ mysql_service_log_builtins_syseventlog_t

Syslog/Eventlog functions for logging services.

◆ mysql_service_log_builtins_t

Primitives for services to interact with the structured logger: functions pertaining to log_line and log_item data.

◆ mysql_service_log_builtins_tmp_t

Temporary primitives for logging services.

Function Documentation

◆ log_line_process_hook_get()

log_line_processor log_line_process_hook_get ( void  )

Get current log-event processor.

When a log-event is submitted, a function is applied to that event. That function usually either buffers the event for later processing, or filters and logs the event. log_line_process_hook_get() returns a pointer to that function.

Return values
apointer to a log-event processing function

◆ log_line_process_hook_set()

void log_line_process_hook_set ( log_line_processor  llp)

Set the log-event processor.

When a log-event is submitted, a function is applied to that event. That function usually either buffers the event for later processing, or filters and logs the event.

That function can be set here.

Parameters
llpA log-processor

Variable Documentation

◆ log_bi

const mysql_service_log_builtins_t* log_bi
extern

accessor built-ins

accessor built-ins

◆ log_bs

string built-ins