From 2b4a359425b386275b868189b8b76f52d4151ae8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 5 Nov 2012 15:49:23 +0000 Subject: reduce call overhead on log messages --- utils/log.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'utils/log.h') diff --git a/utils/log.h b/utils/log.h index b49f439db..ed953f37e 100644 --- a/utils/log.h +++ b/utils/log.h @@ -64,11 +64,13 @@ extern void nslog_log(const char *format, ...); # endif #define LOG(x) \ - do { \ - nslog_log("%s " __FILE__ " %s %i: ", \ - nslog_gettime(), LOG_FN, LOG_LN); \ - nslog_log x; \ - nslog_log("\n"); \ + do { \ + if (verbose_log) { \ + nslog_log("%s " __FILE__ " %s %i: ", \ + nslog_gettime(), LOG_FN, LOG_LN); \ + nslog_log x; \ + nslog_log("\n"); \ + } \ } while(0) #endif -- cgit v1.2.3