summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authorvenaas <venaas>2007-05-03 14:33:22 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-05-03 14:33:22 +0000
commit3837212a51ac4ae4c6a76ee91c9301add8d18ee5 (patch)
tree96629a0ef01ad844dcbc7347ea86ceb317e2b41f /debug.c
parentaea23b7433f130cd0b16e34f9a2525efc31583d6 (diff)
using debug() in getconfig()
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@69 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/debug.c b/debug.c
index f507f50..3959987 100644
--- a/debug.c
+++ b/debug.c
@@ -9,26 +9,22 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
#include <stdarg.h>
#include "debug.h"
-static uint8_t debug_level = 0;
+static uint8_t debug_level = DBG_WARN;
+
+void debug_set_level(uint8_t level) {
+ debug_level = level;
+}
void debug(uint8_t level, char *format, ...) {
- extern int errno;
-
if (level >= debug_level) {
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
- if (errno) {
- fprintf(stderr, ": ");
- perror(NULL);
- fprintf(stderr, "errno=%d\n", errno);
- } else
- fprintf(stderr, "\n");
+ fprintf(stderr, "\n");
}
if (level >= DBG_ERR)
exit(1);