summaryrefslogtreecommitdiff
path: root/src/helper/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper/log.c')
-rw-r--r--src/helper/log.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/helper/log.c b/src/helper/log.c
index fe475130..b2f31dc2 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -69,7 +69,17 @@ void log_printf(enum log_levels level, const char *file, int line, const char *f
if (f != NULL)
file = f + 1;
- fprintf(log_output, "%s %d %ld %s:%d %s(): %s\n", log_strings[level+1], count, time(NULL), file, line, function, buffer);
+ if (debug_level >= LOG_DEBUG)
+ {
+ /* print with count and time information */
+ fprintf(log_output, "%s %d %ld %s:%d %s(): %s\n", log_strings[level+1], count, time(NULL), file, line, function, buffer);
+ }
+ else
+ {
+ /* do not print count and time */
+ fprintf(log_output, "%s %s:%d %s(): %s\n", log_strings[level+1], file, line, function, buffer);
+ }
+
fflush(log_output);
va_end(args);