diff options
author | venaas <venaas> | 2007-05-03 14:33:22 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2007-05-03 14:33:22 +0000 |
commit | 3837212a51ac4ae4c6a76ee91c9301add8d18ee5 (patch) | |
tree | 96629a0ef01ad844dcbc7347ea86ceb317e2b41f /debug.c | |
parent | aea23b7433f130cd0b16e34f9a2525efc31583d6 (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.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -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); |