summaryrefslogtreecommitdiff
path: root/utils/log.h
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2002-10-08 09:38:29 +0000
committerJames Bursa <james@netsurf-browser.org>2002-10-08 09:38:29 +0000
commit53c0e810e5c34cb89c73c6b79b31dfa53b14f90f (patch)
treee642d66e1a496282056bfab06779a436ba21742b /utils/log.h
parent6f095fcdf85d1e2e429979b29d5e5cf49644958c (diff)
downloadnetsurf-53c0e810e5c34cb89c73c6b79b31dfa53b14f90f.tar.gz
netsurf-53c0e810e5c34cb89c73c6b79b31dfa53b14f90f.tar.bz2
[project @ 2002-10-08 09:38:29 by bursa]
LOG(()) macro for easier debugging. svn path=/import/netsurf/; revision=41
Diffstat (limited to 'utils/log.h')
-rw-r--r--utils/log.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/log.h b/utils/log.h
new file mode 100644
index 000000000..4ca658419
--- /dev/null
+++ b/utils/log.h
@@ -0,0 +1,24 @@
+/**
+ * $Id: log.h,v 1.1 2002/10/08 09:38:29 bursa Exp $
+ */
+
+#include <stdio.h>
+
+#ifndef _NETSURF_LOG_H_
+#define _NETSURF_LOG_H_
+
+#ifdef NDEBUG
+
+#define LOG(x) ((void) 0)
+
+#else
+
+#ifdef __GNUC__
+#define LOG(x) (printf(__FILE__ " " __PRETTY_FUNCTION__ " %i: ", __LINE__), printf x, printf("\n"))
+#else
+#define LOG(x) (printf(__FILE__ " %i: ", __LINE__), printf x, printf("\n"))
+#endif
+
+#endif
+
+#endif