Surrounded every log writing command with LOGIF macro, which tests if the given logfile id matches with those enabled. The comparison is done against local variable and expensive function call is avoided.
This commit is contained in:
@ -41,6 +41,8 @@
|
||||
#include <secrets.h>
|
||||
#include <dcb.h>
|
||||
|
||||
extern int lm_enabled_logfiles_bitmask;
|
||||
|
||||
static void monitorMain(void *);
|
||||
|
||||
static char *version_str = "V1.0.0";
|
||||
@ -72,8 +74,10 @@ version()
|
||||
void
|
||||
ModuleInit()
|
||||
{
|
||||
skygw_log_write( LOGFILE_MESSAGE, "Initialise the MySQL Galera Monitor module %s.\n",
|
||||
version_str);
|
||||
LOGIF(LM, (skygw_log_write(
|
||||
LOGFILE_MESSAGE,
|
||||
"Initialise the MySQL Galera Monitor module %s.\n",
|
||||
version_str)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -334,10 +338,11 @@ MONITOR_SERVERS *ptr;
|
||||
|
||||
if (mysql_thread_init())
|
||||
{
|
||||
skygw_log_write_flush(LOGFILE_ERROR,
|
||||
"Fatal : mysql_thread_init failed in monitor "
|
||||
"module. Exiting.\n");
|
||||
return;
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"Fatal : mysql_thread_init failed in monitor "
|
||||
"module. Exiting.\n")));
|
||||
return;
|
||||
}
|
||||
handle->status = MONITOR_RUNNING;
|
||||
while (1)
|
||||
|
Reference in New Issue
Block a user