summaryrefslogtreecommitdiff
path: root/utils/log.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-03-12 19:13:27 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-03-12 19:13:27 +0000
commit0c7c722e238f6e946ff64650e2fb9e1e3d48ff03 (patch)
tree521b8b10bf7c6b4be405e1235068d1b454fbb993 /utils/log.h
parent0fd2523f5fc756e8a4cf5cff9d9e3fea6d69971f (diff)
downloadnetsurf-0c7c722e238f6e946ff64650e2fb9e1e3d48ff03.tar.gz
netsurf-0c7c722e238f6e946ff64650e2fb9e1e3d48ff03.tar.bz2
Log to stderr
svn path=/trunk/netsurf/; revision=11983
Diffstat (limited to 'utils/log.h')
-rw-r--r--utils/log.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/utils/log.h b/utils/log.h
index b676c65bf..b59b6d3f8 100644
--- a/utils/log.h
+++ b/utils/log.h
@@ -28,15 +28,27 @@
#else
extern const char *nslog_gettime(void);
+extern void nslog_log(const char *format, ...);
# ifdef __GNUC__
-# define LOG(x) do { if (verbose_log) (printf("%s " __FILE__ " %s %i: ", nslog_gettime(), __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout)); } while (0)
-
+# define LOG_FN __PRETTY_FUNCTION__
+# define LOG_LN __LINE__
# elif defined(__CC_NORCROFT)
-# define LOG(x) do { if (verbose_log) (printf("%s "__FILE__ " %s %i: ", nslog_gettime(), __func__, __LINE__), printf x, fputc('\n', stdout)); } while (0)
+# define LOG_FN __func__
+# define LOG_LN __LINE__
# else
-# define LOG(x) do { if (verbose_log) (printf("%s" __FILE__ " %i: ", nslog_gettime(), __LINE__), printf x, fputc('\n', stdout)); } while (0)
+# define LOG_FN ""
+# define LOG_LN __LINE__
# endif
+
+#define LOG(x) \
+ do { \
+ nslog_log("%s " __FILE__ " %s %i: ", \
+ nslog_gettime(), LOG_FN, LOG_LN); \
+ nslog_log x; \
+ nslog_log("\n"); \
+ } while(0)
+
#endif
#endif