summaryrefslogtreecommitdiff
path: root/source4/include
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-09 18:25:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:56 -0500
commit3c13509c06b5ff969e51f7cb552e525fc627c1ed (patch)
tree6e2ff46daac0ac08adb5b5b7fa8a0dd58d3c0d2d /source4/include
parent6d0beb088565abeaca53e4346dc94940c7de398e (diff)
downloadsamba-3c13509c06b5ff969e51f7cb552e525fc627c1ed.tar.gz
samba-3c13509c06b5ff969e51f7cb552e525fc627c1ed.tar.bz2
samba-3c13509c06b5ff969e51f7cb552e525fc627c1ed.zip
r12798: print timestamps into the log file, this is not nice code,
but it works for now metze (This used to be commit ec7dbb5a98c112e86399ffcff14eb42c99d8e31d)
Diffstat (limited to 'source4/include')
-rw-r--r--source4/include/debug.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/source4/include/debug.h b/source4/include/debug.h
index ccd1c90040..eaf53bad6a 100644
--- a/source4/include/debug.h
+++ b/source4/include/debug.h
@@ -35,15 +35,24 @@ struct debug_ops {
void (*log_task_id)(int fd);
};
+void do_debug_header(int level);
void do_debug(const char *, ...) PRINTF_ATTRIBUTE(1,2);
extern int DEBUGLEVEL;
#define DEBUGLVL(level) ((level) <= DEBUGLEVEL)
-#define DEBUG(level, body) do { if (DEBUGLVL(level)) do_debug body; } while (0)
-#define DEBUGADD(level, body) DEBUG(level, body)
+#define _DEBUG(level, body, header) do { \
+ if (DEBUGLVL(level)) { \
+ if (header) { \
+ do_debug_header(level); \
+ } \
+ do_debug body; \
+ } \
+} while (0)
+#define DEBUG(level, body) _DEBUG(level, body, True)
+#define DEBUGADD(level, body) _DEBUG(level, body, False)
#define DEBUGC(class, level, body) DEBUG(level, body)
-#define DEBUGADDC(class, level, body) DEBUG(level, body)
+#define DEBUGADDC(class, level, body) DEBUGADD(level, body)
#define DEBUGTAB(n) do_debug_tab(n)
enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2};