changeset 761:99625152176b

Remove message logging if the level is NONE
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 06 Oct 2011 20:55:48 +0200
parents e0b6ab5e8dfe
children 513edd0d31b9
files libfdproto/msg_log.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libfdproto/msg_log.c	Fri Sep 30 22:45:41 2011 +0200
+++ b/libfdproto/msg_log.c	Thu Oct 06 20:55:48 2011 +0200
@@ -129,6 +129,11 @@
 	metharg = ml_conf.causes[cause].metharg;
 	CHECK_POSIX_DO( pthread_mutex_unlock(&ml_conf.lock), );
 	
+	/* Do not log if the level is not at least INFO */
+	if ((meth == FD_MSG_LOGTO_DEBUGONLY) && (fd_g_debug_lvl < INFO)) {
+		return;
+	}
+	
 	/* Get current time */
 	CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &ts), /* continue */);
 	offset += strftime(buftime + offset, sizeof(buftime) - offset, "%D,%T", localtime_r( &ts.tv_sec , &tm ));
"Welcome to our mercurial repository"