From 11de436ba7ef4cc1f583609f2482b1008607d410 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Wed, 3 Jul 2019 20:47:52 +0300 Subject: 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 --- libglusterfs/src/logging.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libglusterfs/src') 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); -- cgit