logging : GF_LOG_NONE logs always

Shouldn't GF_LOG_NONE mean "Never log this"? If so, it's not being
tested for and is, instead, treated as a higher priority than
CRITICAL thus is always logged.

Change-Id: Icad1e02a720a05ff21bd54ebf19c0032e6d5ce03
BUG: 1246794
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Reviewed-on: http://review.gluster.org/11797
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
This commit is contained in:
Mohamed Ashiq 2015-07-29 23:47:34 +05:30 committed by Jeff Darcy
parent 31000d1a62
commit 7b39098376

View File

@ -793,7 +793,7 @@ _gf_log_callingfn (const char *domain, const char *file, const char *function,
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
static char *level_strings[] = {"", /* NONE */
@ -982,7 +982,7 @@ _gf_msg_plain (gf_loglevel_t level, const char *fmt, ...)
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
va_start (ap, fmt);
@ -1018,7 +1018,7 @@ _gf_msg_vplain (gf_loglevel_t level, const char *fmt, va_list ap)
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
ret = vasprintf (&msg, fmt, ap);
@ -1050,7 +1050,7 @@ _gf_msg_plain_nomem (gf_loglevel_t level, const char *msg)
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
ret = _gf_msg_plain_internal (level, msg);
@ -1082,7 +1082,7 @@ _gf_msg_backtrace_nomem (gf_loglevel_t level, int stacksize)
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
bt_size = backtrace (array, ((stacksize <= 200)? stacksize : 200));
@ -1169,7 +1169,7 @@ _gf_msg_nomem (const char *domain, const char *file,
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
if (!domain || !file || !function) {
@ -2038,7 +2038,7 @@ _gf_msg (const char *domain, const char *file, const char *function,
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
if (trace) {
@ -2119,7 +2119,7 @@ _gf_log (const char *domain, const char *file, const char *function, int line,
if (this->loglevel && (level > this->loglevel))
goto out;
}
if (level > ctx->log.loglevel)
if (level > ctx->log.loglevel || level == GF_LOG_NONE)
goto out;
static char *level_strings[] = {"", /* NONE */