Log variables moved to log_manager.h

The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
This commit is contained in:
Johan Wikman
2015-11-04 14:26:53 +02:00
parent 0accf869de
commit 834a88aeda
55 changed files with 10 additions and 262 deletions

View File

@ -30,10 +30,6 @@
#include <log_manager.h>
#include <gwdirs.h>
#include <sys/stat.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/**
* @file adminusers.c - Administration user account management

View File

@ -47,11 +47,6 @@
#include <log_manager.h>
#include <errno.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static buffer_object_t* gwbuf_remove_buffer_object(
GWBUF* buf,
buffer_object_t* bufobj);

View File

@ -82,11 +82,6 @@
/** According to the PCRE manual, this should be a multiple of 3 */
#define MAXSCALE_PCRE_BUFSZ 24
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
extern int setipaddress(struct in_addr *, char *);
static int process_config_context(CONFIG_CONTEXT *);
static int process_config_update(CONFIG_CONTEXT *);

View File

@ -105,10 +105,6 @@
#define ERROR_NO_SHOW_DATABASES "%s: Unable to load database grant information, \
MaxScale authentication will proceed without including database permissions. \
To correct this GRANT SHOW DATABASES ON *.* privilege to the user %s."
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static int getUsers(SERVICE *service, USERS *users);
static int uh_cmpfun( void* v1, void* v2);

View File

@ -82,11 +82,6 @@
#define SSL_ERRBUF_LEN 140
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static DCB *allDCBs = NULL; /* Diagnostics need a list of DCBs */
static DCB *zombies = NULL;
static SPINLOCK dcbspin = SPINLOCK_INIT;

View File

@ -1,10 +1,5 @@
#include <externcmd.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/**
* Tokenize a string into arguments suitable for a execvp call.
* @param args Argument string

View File

@ -38,11 +38,6 @@
#include <skygw_utils.h>
#include <log_manager.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static SPINLOCK filter_spin = SPINLOCK_INIT; /**< Protects the list of all filters */
static FILTER_DEF *allFilters = NULL; /**< The list of all filters */

View File

@ -101,16 +101,6 @@ time_t MaxScaleStarted;
extern char *program_invocation_name;
extern char *program_invocation_short_name;
/**
* Variable holding the enabled logfiles information.
* Used from log users to check enabled logs prior calling
* actual library calls such as skygw_log_write.
*/
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/*
* Server options are passed to the mysql_server_init. Each gateway must have a unique
* data directory that is passed to the mysql_server_init, therefore the data directory

View File

@ -48,11 +48,6 @@
SPINLOCK tmplock = SPINLOCK_INIT;
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/*
* Set IP address in socket structure in_addr
*
@ -245,4 +240,4 @@ long get_processor_count()
#error _SC_NPROCESSORS_ONLN not available.
#endif
return processors;
}
}

View File

@ -51,11 +51,6 @@
#include <gw.h>
#include <gwdirs.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static MODULES *registered = NULL;
static MODULES *find_module(const char *module);

View File

@ -33,11 +33,6 @@
#include <mysql_client_server_protocol.h>
#include <modutil.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/** These are used when converting MySQL wildcards to regular expressions */
static SPINLOCK re_lock = SPINLOCK_INIT;
static bool pattern_init = false;

View File

@ -43,11 +43,6 @@
#include <secrets.h>
#include <mysql/mysqld_error.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static MONITOR *allMonitors = NULL;
static SPINLOCK monLock = SPINLOCK_INIT;
@ -526,4 +521,4 @@ bool check_monitor_permissions(MONITOR* monitor)
mysql_close(mysql);
free(dpasswd);
return rval;
}
}

View File

@ -46,11 +46,6 @@ extern unsigned long hkheartbeat;
MEMLOG *plog;
#endif
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
int number_poll_spins;
int max_poll_sleep;

View File

@ -24,10 +24,6 @@
#include <mysql_client_server_protocol.h>
#include <gwdirs.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/**
* Generate a random printable character
*

View File

@ -48,11 +48,6 @@
#include <skygw_utils.h>
#include <log_manager.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static SPINLOCK server_spin = SPINLOCK_INIT;
static SERVER *allServers = NULL;

View File

@ -66,11 +66,6 @@
#include <gwdirs.h>
#include <math.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
static RSA *rsa_512 = NULL;
static RSA *rsa_1024 = NULL;

View File

@ -45,11 +45,6 @@
#include <log_manager.h>
#include <housekeeper.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/** Global session id; updated safely by holding session_spin */
static size_t session_id;

View File

@ -44,11 +44,6 @@
#include <log_manager.h>
#include <secrets.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/* used in the hex2bin function */
#define char_val(X) (X >= '0' && X <= '9' ? X-'0' :\
X >= 'A' && X <= 'Z' ? X-'A'+10 :\