summaryrefslogtreecommitdiff
path: root/server/util
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-10-07 07:43:53 -0400
committerSimo Sorce <idra@samba.org>2008-10-07 07:43:53 -0400
commita53047557987563691b2ab902fe6f5103707ff8a (patch)
tree801e1f814f76f578476b825a8276f29f5c662a23 /server/util
parentb4cd915ef70f74427d71cde238db56a1876b5b06 (diff)
downloadsssd-a53047557987563691b2ab902fe6f5103707ff8a.tar.gz
sssd-a53047557987563691b2ab902fe6f5103707ff8a.tar.bz2
sssd-a53047557987563691b2ab902fe6f5103707ff8a.zip
Add primitive debugging capabilities.
So far debug goes to stderr so sssd need to be run int interactive mode (-i option)
Diffstat (limited to 'server/util')
-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 495e3a24..1ca35930 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