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;
}
}
+void debug_no_timestamp() {
+ debug_timestamp = 0;
+}
+
uint8_t debug_get_level() {
return debug_level;
}
}
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';
void debug_init(char *ident);
void debug_set_level(uint8_t level);
+void debug_no_timestamp();
uint8_t debug_get_level();
void debug(uint8_t level, char *format, ...);
void debugx(int status, uint8_t level, char *format, ...);