3103
Prints a printf style message to the error log and, under NT, to the
3106
This function prints the message into a buffer and then sends that buffer
3107
to other functions to write that message to other logging sources.
3109
@param event_type Type of event to write (Error, Warning, or Info)
3110
@param format Printf style format of message
3111
@param args va_list list of arguments for the message
3114
The function always returns 0. The return value is present in the
3115
signature to be compatible with other logging routines, which could
3116
return an error (e.g. logging to the log tables)
3118
static void print_buffer_to_file(enum loglevel level, int,
3119
const char *buffer, size_t)
3125
pthread_mutex_lock(&LOCK_error_log);
3128
localtime_r(&skr, &tm_tmp);
3131
fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n",
3132
start->tm_year % 100,
3138
(level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
3139
"Warning" : "Note"),
3144
pthread_mutex_unlock(&LOCK_error_log);
3149
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
3153
int error_code= errno;
3155
length= vsnprintf(buff, sizeof(buff), format, args);
3157
print_buffer_to_file(level, error_code, buff, length);
3163
3102
void sql_print_error(const char *format, ...)