From bfac66f129646bc78f1ed3a7dccb3010114e57aa Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 7 Aug 2012 13:13:24 +0530 Subject: logging: do the 'right' check for loglevel logging functions should not print anything if loglevel in argument list is lower than what is set for the process. Change-Id: Id61779ffe6b76724243aa222c6889dd51a8f2f9b Signed-off-by: Amar Tumballi BUG: 846201 Reviewed-on: http://review.gluster.com/3786 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/logging.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libglusterfs/src/logging.c') diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index 40981b526..785608709 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -192,9 +192,9 @@ _gf_log_nomem (const char *domain, const char *file, if (ctx->log.gf_log_xl_log_set) { if (this->loglevel && (level > this->loglevel)) goto out; - else if (level > ctx->log.loglevel) - goto out; } + if (level > ctx->log.loglevel) + goto out; static char *level_strings[] = {"", /* NONE */ "M", /* EMERGENCY */ @@ -308,9 +308,9 @@ _gf_log_callingfn (const char *domain, const char *file, const char *function, if (ctx->log.gf_log_xl_log_set) { if (this->loglevel && (level > this->loglevel)) goto out; - else if (level > ctx->log.loglevel) - goto out; } + if (level > ctx->log.loglevel) + goto out; static char *level_strings[] = {"", /* NONE */ "M", /* EMERGENCY */ @@ -445,9 +445,9 @@ _gf_log (const char *domain, const char *file, const char *function, int line, if (ctx->log.gf_log_xl_log_set) { if (this->loglevel && (level > this->loglevel)) goto out; - else if (level > ctx->log.loglevel) - goto out; } + if (level > ctx->log.loglevel) + goto out; static char *level_strings[] = {"", /* NONE */ "M", /* EMERGENCY */ -- cgit