[Asterisk-cvs] asterisk logger.c,1.45,1.46

markster at lists.digium.com markster at lists.digium.com
Sun Oct 24 02:08:39 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv5379

Modified Files:
	logger.c 
Log Message:
Don't execute log functions for log levels we don't track


Index: logger.c
===================================================================
RCS file: /usr/cvsroot/asterisk/logger.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- logger.c	28 Sep 2004 21:13:50 -0000	1.45
+++ logger.c	24 Oct 2004 06:12:21 -0000	1.46
@@ -52,6 +52,7 @@
 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 @@
 	logchannels = NULL;
 	ast_mutex_unlock(&loglock);
 	
+	global_logmask = 0;
 	/* close syslog */
 	closelog();
 	
@@ -241,6 +243,7 @@
 		if (chan) {
 			chan->next = logchannels;
 			logchannels = chan;
+			global_logmask |= chan->logmask;
 		}
 		var = var->next;
 	}
@@ -507,6 +510,9 @@
 	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);




More information about the svn-commits mailing list