summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-09-07 21:07:03 +0100
committerVincent Sanders <vince@kyllikki.org>2017-09-07 21:07:03 +0100
commit3f3e7de6d94d66d515d43d4e921092f340788e4f (patch)
treef2cbf3e6e2610c97a6a4d79737861c113a160cc9
parent3a633acc3f3eb4d1199e9a7193ff293a25947031 (diff)
downloadnetsurf-3f3e7de6d94d66d515d43d4e921092f340788e4f.tar.gz
netsurf-3f3e7de6d94d66d515d43d4e921092f340788e4f.tar.bz2
do not attempt to log when output is not enabled
-rw-r--r--utils/log.c25
1 files 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