aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-24 06:12:21 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-24 06:12:21 +0000
commit081dde225089e73446fa6b19eeb0979ff268f20f (patch)
tree6e1ce84ef5d121df8e1d991f59cf6e7dc8fd6a5f /logger.c
parent8116d7dde412e399fae3dc5b6a3a1720edcc5aef (diff)
Don't execute log functions for log levels we don't track
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4078 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rwxr-xr-xlogger.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/logger.c b/logger.c
index 683c186da..0fd0b2f29 100755
--- a/logger.c
+++ b/logger.c
@@ -52,6 +52,7 @@ static char dateformat[256] = "%b %e %T"; /* Original Asterisk Format */
AST_MUTEX_DEFINE_STATIC(msglist_lock);
AST_MUTEX_DEFINE_STATIC(loglock);
static int pending_logger_reload = 0;
+static int global_logmask = 0;
static struct msglist {
char *msg;
@@ -211,6 +212,7 @@ static void init_logger_chain(void)
logchannels = NULL;
ast_mutex_unlock(&loglock);
+ global_logmask = 0;
/* close syslog */
closelog();
@@ -241,6 +243,7 @@ static void init_logger_chain(void)
if (chan) {
chan->next = logchannels;
logchannels = chan;
+ global_logmask |= chan->logmask;
}
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)) {
return;
}
+ /* Ignore anything that never gets logged anywhere */
+ if (!(global_logmask & (1 << level)))
+ return;
/* begin critical section */
ast_mutex_lock(&loglock);