diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-11-05 15:49:23 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-11-05 15:49:23 +0000 |
commit | 2b4a359425b386275b868189b8b76f52d4151ae8 (patch) | |
tree | cfe710713c996ccf3bba50594eaffcbb8ddb4481 /utils | |
parent | 07a53f4b44f7bccc8a46a89589724e3ff16d64b6 (diff) | |
download | netsurf-2b4a359425b386275b868189b8b76f52d4151ae8.tar.gz netsurf-2b4a359425b386275b868189b8b76f52d4151ae8.tar.bz2 |
reduce call overhead on log messages
Diffstat (limited to 'utils')
-rw-r--r-- | utils/log.c | 10 | ||||
-rw-r--r-- | utils/log.h | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/utils/log.c b/utils/log.c index 9f2e172bc..96a6d3c5b 100644 --- a/utils/log.c +++ b/utils/log.c @@ -109,15 +109,13 @@ const char *nslog_gettime(void) void nslog_log(const char *format, ...) { - if (verbose_log) { - va_list ap; + va_list ap; - va_start(ap, format); + va_start(ap, format); - vfprintf(stderr, format, ap); + vfprintf(stderr, format, ap); - va_end(ap); - } + va_end(ap); } #endif 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 |