diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-07-03 20:47:52 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-07-16 17:53:48 +0000 |
commit | 11de436ba7ef4cc1f583609f2482b1008607d410 (patch) | |
tree | 6770440e195f62f0c1622a9c7c64d1f51849620f /libglusterfs/src | |
parent | 47e9658fd9014d9a4b67718aa9fbbdf11bf93c0e (diff) |
logging.c: check for skip_logging() in _gf_slog(), _gf_smsg()
Before processing anything, check if we actually need to do any logging,
based on the log level.
Change-Id: Iec5b9869831e1bdf22d12becc5e3d3ece87906a7
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/logging.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index 0134d237cb4..85bfaf0b3ef 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -2442,6 +2442,10 @@ _gf_smsg(const char *domain, const char *file, const char *function, va_list valist; char *msg = NULL; int ret = 0; + xlator_t *this = THIS; + + if (skip_logging(this, level)) + return ret; va_start(valist, event); ret = _do_slog_format(event, valist, &msg); @@ -2465,6 +2469,10 @@ _gf_slog(const char *domain, const char *file, const char *function, int line, va_list valist; char *msg = NULL; int ret = 0; + xlator_t *this = THIS; + + if (skip_logging(this, level)) + return ret; va_start(valist, event); ret = _do_slog_format(event, valist, &msg); |