Session-specific logging. Added functions

void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** 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;
This commit is contained in:
VilhoRaatikka
2014-11-19 00:08:59 +02:00
parent 7ef54219a6
commit fd11e6a7f5
39 changed files with 379 additions and 133 deletions

View File

@ -53,7 +53,10 @@ MODULE_INFO info = {
"The admin user interface"
};
extern int lm_enabled_logfiles_bitmask;
/** 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 char *version_str = "V1.0.0";