From 3f3e7de6d94d66d515d43d4e921092f340788e4f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 7 Sep 2017 21:07:03 +0100 Subject: do not attempt to log when output is not enabled --- utils/log.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/utils/log.c b/utils/log.c index 3dbb5c6b3..5ebe51f99 100644 --- a/utils/log.c +++ b/utils/log.c @@ -105,20 +105,21 @@ netsurf_render_log(void *_ctx, const char *fmt, va_list args) { + if (verbose_log) { + fprintf(logfile, + "%s %.*s:%i %.*s: ", + nslog_gettime(), + ctx->filenamelen, + ctx->filename, + ctx->lineno, + ctx->funcnamelen, + ctx->funcname); - fprintf(logfile, - "%s %.*s:%i %.*s: ", - nslog_gettime(), - ctx->filenamelen, - ctx->filename, - ctx->lineno, - ctx->funcnamelen, - ctx->funcname); - - vfprintf(logfile, fmt, args); + vfprintf(logfile, fmt, args); - /* Log entries aren't newline terminated add one for clarity */ - fputc('\n', logfile); + /* Log entries aren't newline terminated add one for clarity */ + fputc('\n', logfile); + } } #else -- cgit v1.2.3