From 25e22eb1f5046fdf9ef1d470b86faf640375de08 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 30 May 2007 22:27:58 +0000 Subject: Add a -v option to enable debug logging. Pass -v by default to the RO runimage. svn path=/trunk/netsurf/; revision=3306 --- utils/log.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/log.h b/utils/log.h index 6ad17bb0d..86a933a40 100644 --- a/utils/log.h +++ b/utils/log.h @@ -7,6 +7,7 @@ */ #include +#include "netsurf/desktop/netsurf.h" #ifndef _NETSURF_LOG_H_ #define _NETSURF_LOG_H_ @@ -15,11 +16,11 @@ # define LOG(x) ((void) 0) #else # ifdef __GNUC__ -# define LOG(x) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout)) +# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout)); } while (0) # elif defined(__CC_NORCROFT) -# define LOG(x) (printf(__FILE__ " %s %i: ", __func__, __LINE__), printf x, fputc('\n', stdout)) +# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %s %i: ", __func__, __LINE__), printf x, fputc('\n', stdout)); } while (0) # else -# define LOG(x) (printf(__FILE__ " %i: ", __LINE__), printf x, fputc('\n', stdout)) +# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %i: ", __LINE__), printf x, fputc('\n', stdout)); } while (0) # endif #endif -- cgit v1.2.3