|
|
@ -52,6 +52,7 @@ static char dateformat[256] = "%b %e %T"; /* Original Asterisk Format */
|
|
|
|
AST_MUTEX_DEFINE_STATIC(msglist_lock);
|
|
|
|
AST_MUTEX_DEFINE_STATIC(msglist_lock);
|
|
|
|
AST_MUTEX_DEFINE_STATIC(loglock);
|
|
|
|
AST_MUTEX_DEFINE_STATIC(loglock);
|
|
|
|
static int pending_logger_reload = 0;
|
|
|
|
static int pending_logger_reload = 0;
|
|
|
|
|
|
|
|
static int global_logmask = 0;
|
|
|
|
|
|
|
|
|
|
|
|
static struct msglist {
|
|
|
|
static struct msglist {
|
|
|
|
char *msg;
|
|
|
|
char *msg;
|
|
|
@ -211,6 +212,7 @@ static void init_logger_chain(void)
|
|
|
|
logchannels = NULL;
|
|
|
|
logchannels = NULL;
|
|
|
|
ast_mutex_unlock(&loglock);
|
|
|
|
ast_mutex_unlock(&loglock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global_logmask = 0;
|
|
|
|
/* close syslog */
|
|
|
|
/* close syslog */
|
|
|
|
closelog();
|
|
|
|
closelog();
|
|
|
|
|
|
|
|
|
|
|
@ -241,6 +243,7 @@ static void init_logger_chain(void)
|
|
|
|
if (chan) {
|
|
|
|
if (chan) {
|
|
|
|
chan->next = logchannels;
|
|
|
|
chan->next = logchannels;
|
|
|
|
logchannels = chan;
|
|
|
|
logchannels = chan;
|
|
|
|
|
|
|
|
global_logmask |= chan->logmask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var = var->next;
|
|
|
|
var = var->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -507,6 +510,9 @@ void ast_log(int level, const char *file, int line, const char *function, const
|
|
|
|
if (!option_verbose && !option_debug && (level == __LOG_DEBUG)) {
|
|
|
|
if (!option_verbose && !option_debug && (level == __LOG_DEBUG)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Ignore anything that never gets logged anywhere */
|
|
|
|
|
|
|
|
if (!(global_logmask & (1 << level)))
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
/* begin critical section */
|
|
|
|
/* begin critical section */
|
|
|
|
ast_mutex_lock(&loglock);
|
|
|
|
ast_mutex_lock(&loglock);
|
|
|
|