372
372
virtual ~Log_event_handler() {}
376
/* Class which manages slow, general and error log event handlers */
379
rw_lock_t LOCK_logger;
380
/* flag to check whether logger mutex is initialized */
383
/* NULL-terminated arrays of log handlers */
384
Log_event_handler *error_log_handler_list[MAX_LOG_HANDLERS_NUM + 1];
390
void lock_shared() { rw_rdlock(&LOCK_logger); }
391
void lock_exclusive() { rw_wrlock(&LOCK_logger); }
392
void unlock() { rw_unlock(&LOCK_logger); }
393
bool log_command(Session *session, enum enum_server_command command);
396
We want to initialize all log mutexes as soon as possible,
397
but we cannot do it in constructor, as safe_mutex relies on
398
initialization, performed by MY_INIT(). This why this is done in
402
bool flush_logs(Session *session);
403
/* Perform basic logger cleanup. this will leave e.g. error log open. */
405
/* Free memory. Nothing could be logged after this function is called */
407
bool error_log_print(enum loglevel level, const char *format,
409
/* we use this function to setup all enabled log event handlers */
410
int set_handlers(uint32_t error_log_printer);
411
void init_error_log(uint32_t error_log_printer);
414
375
extern TYPELIB binlog_format_typelib;
416
377
void sql_print_error(const char *format, ...) __attribute__((format(printf, 1, 2)));
421
382
__attribute__((format(printf, 1, 2)));
422
383
extern sql_print_message_func sql_print_message_handlers[];
424
int error_log_print(enum loglevel level, const char *format,
427
385
void sql_perror(const char *message);