summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohamed Ashiq <mliyazud@redhat.com>2015-07-29 23:47:34 +0530
committerNiels de Vos <ndevos@redhat.com>2015-10-28 03:08:20 -0700
commitb7d43986eb33811071173d394b5778bede6188c1 (patch)
tree2c5616fdb9ce7448f8e913de0d014142d9110537 /libglusterfs
parentc11e3232963d28b4cdf73b694d82f7b6ed38894f (diff)
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. Backport of http://review.gluster.org/11797 Cherry picked from 7b390983768e833a8df15b994038155c53d71bdd >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> Change-Id: Icad1e02a720a05ff21bd54ebf19c0032e6d5ce03 BUG: 1259167 Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> Reviewed-on: http://review.gluster.org/12087 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/logging.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index af14163c360..511b1037384 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -798,7 +798,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 */
@@ -987,7 +987,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);
@@ -1023,7 +1023,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);
@@ -1055,7 +1055,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);
@@ -1087,7 +1087,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));
@@ -1174,7 +1174,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) {
@@ -2043,7 +2043,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) {
@@ -2124,7 +2124,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 */