summaryrefslogtreecommitdiffstats
path: root/server/util/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/util/util.h')
-rw-r--r--server/util/util.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/util/util.h b/server/util/util.h
index 495e3a241..1ca359303 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -1,9 +1,18 @@
#ifndef __SSSD_UTIL_H__
#define __SSSD_UTIL_H__
+#include <stdio.h>
#include <stdbool.h>
-#define DEBUG(level, body)
+extern int debug_level;
+void debug_fn(const char *format, ...);
+
+#define DEBUG(level, body) do { \
+ if (level <= debug_level) { \
+ debug_fn("%s[%s]: ", __location__, __FUNCTION__); \
+ debug_fn body; \
+ } \
+} while(0);
#define DEBUGADD(level, body)
#ifndef discard_const