summaryrefslogtreecommitdiffstats
path: root/helper.c
diff options
context:
space:
mode:
authorSimon Rettberg2017-05-30 15:46:01 +0200
committerSimon Rettberg2017-05-30 15:46:01 +0200
commite38ec5672aea398491911076fdc9f9c233624c0d (patch)
treeb9ac72b8e4b3f6db5339e5d1c69884402a39d5f6 /helper.c
parentSupport specifying custom attribute names for schema (diff)
downloadldadp-e38ec5672aea398491911076fdc9f9c233624c0d.tar.gz
ldadp-e38ec5672aea398491911076fdc9f9c233624c0d.tar.xz
ldadp-e38ec5672aea398491911076fdc9f9c233624c0d.zip
Introduce debug levels, AD filter bug workaround, fix legacy homeattr not being lowercased
Diffstat (limited to 'helper.c')
-rw-r--r--helper.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/helper.c b/helper.c
index b125f42..fb0e4a9 100644
--- a/helper.c
+++ b/helper.c
@@ -11,6 +11,8 @@
#include <fcntl.h>
#include <stdarg.h>
+DebugLevel _debugLevel = DEBUG_WARNING;
+
void bail(char *args, ...)
{
printf("ERROR: ");
@@ -201,3 +203,13 @@ void helper_printfilter(struct Filter* f)
putchar('\n');
}
+void plog(const DebugLevel debugLevel, char *args, ...)
+{
+ if (debugLevel < _debugLevel) return;
+ va_list argList;
+ va_start(argList, args);
+ vprintf(args, argList);
+ va_end(argList);
+ putchar('\n');
+ fflush(stdout);
+}