MySQL 8.4.0
Source Code Documentation
log_sink_trad.h File Reference

Functions in the built-in log-sink (i.e. More...

#include "log_builtins_internal.h"
#include "my_compiler.h"

Go to the source code of this file.

Functions

ssize_t parse_trad_field (const char *parse_from, const char **token_end, const char *buf_end)
 Find the end of the current field (' ') More...
 
log_service_error log_sink_trad_parse_log_line (const char *line_start, size_t line_length)
 Parse a single line in the traditional error log. More...
 
int log_sink_trad (void *instance, log_line *ll)
 services: log sinks: basic logging ("classic error-log") Will write timestamp, label, thread-ID, and message to stderr/file. More...
 

Detailed Description

Functions in the built-in log-sink (i.e.

the writer for the traditional MySQL error log):

a) writing an error log event to the traditional error log file b) parsing a line from the traditional error log file

Function Documentation

◆ log_sink_trad()

int log_sink_trad ( void *  instance,
log_line ll 
)

services: log sinks: basic logging ("classic error-log") Will write timestamp, label, thread-ID, and message to stderr/file.

If you should not be able to specify a label, one will be generated for you from the line's priority field.

Parameters
instanceinstance handle
llthe log line to write
Return values
intnumber of added fields, if any

◆ log_sink_trad_parse_log_line()

log_service_error log_sink_trad_parse_log_line ( const char *  line_start,
size_t  line_length 
)

Parse a single line in the traditional error log.

Parameters
line_startpointer to the beginning of the line ('2' of the ISO-date)
line_lengthlength of the line
Return values
LOG_SERVICE_ARGUMENT_TOO_LONGToken too long for its field
LOG_SERVICE_PARSE_ERRORNo more spaces in line, cannot find expected end of token, or input otherwise malformed
LOG_SERVICE_SUCCESSEvent added to ring-buffer

◆ parse_trad_field()

ssize_t parse_trad_field ( const char *  parse_from,
const char **  token_end,
const char *  buf_end 
)

Find the end of the current field (' ')

Parameters
parse_fromstart of the token
token_endwhere to store the address of the delimiter found
buf_endend of the input line
Return values
-1delimiter not found, "parsing" failed
>=0length of token