LOGIF and skygw_write_log removed from server/core/*.c

LOGIF and skygw_write_log removed from server/core/*.c and
replaced with calls to MXS_(ERROR|WARNING|NOTICE|INFO|DEBUG).
This is a mechanism change, no updating of the actual message
has been performed.

Currently this causes a very small performance hit, since the
check whether the priority is enabled or not is performed in
the function that is called and not before the function is called.
Once all LOGIFs and skygw_write_logs have been replaced, the
behaviour will be altered back to what it was.
This commit is contained in:
Johan Wikman
2015-11-15 19:37:15 +02:00
parent 1f15843d61
commit 44df53d846
19 changed files with 1367 additions and 1992 deletions

View File

@ -74,26 +74,22 @@ setipaddress(struct in_addr *a, char *p) {
hint.ai_flags = AI_PASSIVE;
hint.ai_family = AF_UNSPEC;
if ((rc = getaddrinfo(p, NULL, &hint, &ai)) != 0) {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error: Failed to obtain address for host %s, %s",
p,
gai_strerror(rc))));
MXS_ERROR("Failed to obtain address for host %s, %s",
p,
gai_strerror(rc));
return 0;
return 0;
}
} else {
hint.ai_flags = AI_CANONNAME;
hint.ai_family = AF_INET;
if ((rc = getaddrinfo(p, NULL, &hint, &ai)) != 0) {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error: Failed to obtain address for host %s, %s",
p,
gai_strerror(rc))));
MXS_ERROR("Failed to obtain address for host %s, %s",
p,
gai_strerror(rc));
return 0;
return 0;
}
}
@ -115,12 +111,9 @@ setipaddress(struct in_addr *a, char *p) {
if (h == NULL) {
if ((a->s_addr = inet_addr(p)) == -1) {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : gethostbyname failed for [%s]",
p)));
MXS_ERROR("gethostbyname failed for [%s]", p);
return 0;
return 0;
}
} else {
/* take the first one */
@ -208,11 +201,8 @@ struct hostent *hp;
}
else
{
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Failed to lookup host '%s'. ",
buf)));
return 0;
MXS_ERROR("Failed to lookup host '%s'.", buf);
return 0;
}
}
}
@ -233,7 +223,7 @@ long get_processor_count()
#ifdef _SC_NPROCESSORS_ONLN
if ((processors = sysconf(_SC_NPROCESSORS_ONLN)) <= 0)
{
skygw_log_write(LE, "Unable to establish the number of available cores. Defaulting to 4.");
MXS_WARNING("Unable to establish the number of available cores. Defaulting to 4.");
processors = 4;
}
#else