fix multi-logging

This commit is contained in:
Enno Rehling 2016-05-01 13:40:01 +02:00
parent 41277ed5ee
commit f24b1c1cdc
1 changed files with 4 additions and 1 deletions

View File

@ -192,13 +192,16 @@ static void log_write(int flags, const char *module, const char *format, va_list
int level = flags & LOG_LEVELS; int level = flags & LOG_LEVELS;
if (lg->flags & level) { if (lg->flags & level) {
int dupe = 0; int dupe = 0;
va_list copy;
va_copy(copy, args);
if (lg->flags & LOG_BRIEF) { if (lg->flags & LOG_BRIEF) {
dupe = check_dupe(format, level); dupe = check_dupe(format, level);
} }
if (dupe == 0) { if (dupe == 0) {
lg->log(lg->data, level, NULL, format, args); lg->log(lg->data, level, NULL, format, copy);
} }
va_end(copy);
} }
} }
} }