From 3837212a51ac4ae4c6a76ee91c9301add8d18ee5 Mon Sep 17 00:00:00 2001 From: venaas Date: Thu, 3 May 2007 14:33:22 +0000 Subject: using debug() in getconfig() git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@69 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- debug.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index f507f50..3959987 100644 --- a/debug.c +++ b/debug.c @@ -9,26 +9,22 @@ #include #include #include -#include #include #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); -- cgit v1.2.3