Remove warning when compiling libmysqld/log.cc
sql/log.cc: define print_buffer_to_file only ifdef EMBEDDED_LIBRARY, to avoid "defined but not used" warning
This commit is contained in:
parent
942bb0dfd9
commit
465cf7380a
62
sql/log.cc
62
sql/log.cc
@ -2229,37 +2229,6 @@ static bool test_if_number(register const char *str,
|
||||
} /* test_if_number */
|
||||
|
||||
|
||||
static void print_buffer_to_file(enum loglevel level, const char *buffer)
|
||||
{
|
||||
time_t skr;
|
||||
struct tm tm_tmp;
|
||||
struct tm *start;
|
||||
DBUG_ENTER("print_buffer_to_file");
|
||||
DBUG_PRINT("enter",("buffer: %s", buffer));
|
||||
|
||||
VOID(pthread_mutex_lock(&LOCK_error_log));
|
||||
|
||||
skr=time(NULL);
|
||||
localtime_r(&skr, &tm_tmp);
|
||||
start=&tm_tmp;
|
||||
fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n",
|
||||
start->tm_year % 100,
|
||||
start->tm_mon+1,
|
||||
start->tm_mday,
|
||||
start->tm_hour,
|
||||
start->tm_min,
|
||||
start->tm_sec,
|
||||
(level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
|
||||
"Warning" : "Note"),
|
||||
buffer);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
VOID(pthread_mutex_unlock(&LOCK_error_log));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
void sql_perror(const char *message)
|
||||
{
|
||||
#ifdef HAVE_STRERROR
|
||||
@ -2387,6 +2356,37 @@ void vprint_msg_to_log(enum loglevel level __attribute__((unused)),
|
||||
va_list argsi __attribute__((unused)))
|
||||
{}
|
||||
#else /*!EMBEDDED_LIBRARY*/
|
||||
static void print_buffer_to_file(enum loglevel level, const char *buffer)
|
||||
{
|
||||
time_t skr;
|
||||
struct tm tm_tmp;
|
||||
struct tm *start;
|
||||
DBUG_ENTER("print_buffer_to_file");
|
||||
DBUG_PRINT("enter",("buffer: %s", buffer));
|
||||
|
||||
VOID(pthread_mutex_lock(&LOCK_error_log));
|
||||
|
||||
skr=time(NULL);
|
||||
localtime_r(&skr, &tm_tmp);
|
||||
start=&tm_tmp;
|
||||
fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n",
|
||||
start->tm_year % 100,
|
||||
start->tm_mon+1,
|
||||
start->tm_mday,
|
||||
start->tm_hour,
|
||||
start->tm_min,
|
||||
start->tm_sec,
|
||||
(level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
|
||||
"Warning" : "Note"),
|
||||
buffer);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
VOID(pthread_mutex_unlock(&LOCK_error_log));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
|
||||
{
|
||||
char buff[1024];
|
||||
|
Loading…
x
Reference in New Issue
Block a user