# HG changeset patch # User Sebastien Decugis # Date 1317927348 -7200 # Node ID 99625152176b86dd33ced236b1817fa7bcba13ca # Parent e0b6ab5e8dfe8cff46845af5632f0eee7d9697e7 Remove message logging if the level is NONE diff -r e0b6ab5e8dfe -r 99625152176b libfdproto/msg_log.c --- 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 ));