aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-30 13:34:59 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-09-30 13:34:59 +0200
commitd30cef3c11f07889c2f8e86340b013174d28fc5c (patch)
treeb4c935edff52f9829e1e8fd927a681596e26b4a8 /debug.c
parent96730567e4a1fc835ed8a2c93988c2cacd1f914c (diff)
downloaddovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.tar.gz
dovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.tar.xz
dovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.zip
start of rewrite
Diffstat (limited to '')
-rw-r--r--debug.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/debug.c b/debug.c
new file mode 100644
index 0000000..6f5de19
--- /dev/null
+++ b/debug.c
@@ -0,0 +1,25 @@
+#define _BSD_SOURCE
+#include <syslog.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include "plugin.h"
+
+static void _debug(const char *format, va_list ap)
+{
+#if defined(DEBUG_SYSLOG)
+ vsyslog(LOG_DEBUG, format, ap);
+#elif defined(DEBUG_STDERR)
+ vfprintf(stderr, format, ap);
+#else
+#error no logging method
+#endif
+}
+
+void debug(const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ _debug(fmt, args);
+ va_end(args);
+}