diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2007-05-30 22:27:58 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2007-05-30 22:27:58 +0000 |
commit | 25e22eb1f5046fdf9ef1d470b86faf640375de08 (patch) | |
tree | 9d4b5fd8f5dc258cb61888d0063a64498f412d42 /utils/log.h | |
parent | 7bc1a41ea0f2188de75445e0e23993b6c6b0006f (diff) | |
download | netsurf-25e22eb1f5046fdf9ef1d470b86faf640375de08.tar.gz netsurf-25e22eb1f5046fdf9ef1d470b86faf640375de08.tar.bz2 |
Add a -v option to enable debug logging. Pass -v by default to the RO runimage.
svn path=/trunk/netsurf/; revision=3306
Diffstat (limited to 'utils/log.h')
-rw-r--r-- | utils/log.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 <stdio.h> +#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 |