forked from auracaster/openocd
log: avoid incrementing 'count' for discarded log lines
This matches the behaviour of code which calls LOG_DEBUG_IO etc. instead. Change-Id: I7679f0fc67222f947a4d0f1d53aa627a186ebcd3 Signed-off-by: R. Diez <rdiez-2006@rd10.de> Reviewed-on: https://review.openocd.org/c/openocd/+/9318 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
+4
-3
@@ -153,10 +153,11 @@ void log_printf(enum log_levels level,
|
||||
char *string;
|
||||
va_list ap;
|
||||
|
||||
count++;
|
||||
if (level > debug_level)
|
||||
return;
|
||||
|
||||
count++;
|
||||
|
||||
va_start(ap, format);
|
||||
|
||||
string = alloc_vprintf(format, ap);
|
||||
@@ -173,11 +174,11 @@ void log_vprintf_lf(enum log_levels level, const char *file, unsigned int line,
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
count++;
|
||||
|
||||
if (level > debug_level)
|
||||
return;
|
||||
|
||||
count++;
|
||||
|
||||
tmp = alloc_vprintf(format, args);
|
||||
|
||||
if (!tmp)
|
||||
|
||||
Reference in New Issue
Block a user