diff options
author | venaas <venaas> | 2008-08-29 07:57:31 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-08-29 07:57:31 +0000 |
commit | b1389a93d584676afdf49313ae2eae58e58fb5c5 (patch) | |
tree | d3f929567984ab5ddf88641d2911601d3faf8d0d /debug.c | |
parent | 0e6647a3d9bae452a5db41d9786a0c2cc1c43338 (diff) |
added notimestamp option to debug
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@361 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -24,6 +24,7 @@ static char *debug_ident = NULL; static uint8_t debug_level = DBG_INFO; static FILE *debug_file = NULL; static int debug_syslogfacility = 0; +static uint8_t debug_timestamp = 1; void debug_init(char *ident) { debug_file = stderr; @@ -48,6 +49,10 @@ void debug_set_level(uint8_t level) { } } +void debug_no_timestamp() { + debug_timestamp = 0; +} + uint8_t debug_get_level() { return debug_level; } @@ -116,8 +121,7 @@ void debug_logit(uint8_t level, const char *format, va_list ap) { } vsyslog(priority, format, ap); } else { - timebuf = malloc(256); - if (timebuf) { + if (debug_timestamp && (timebuf = malloc(256))) { gettimeofday(&now, NULL); ctime_r(&now.tv_sec, timebuf); timebuf[strlen(timebuf) - 1] = '\0'; |