logging: log_vprintf: prune ansi sequences when not interactive

Previously colored output using the inline TERM_* macros from color_out.h was
done only using the color_printf() function. Since there are now places
where they are used with log_msg(), we need to prune ansi codes here
too.
This commit is contained in:
Martin Piatka
2022-09-27 14:12:18 +02:00
parent 7b23d63a72
commit 7e27491a2b
3 changed files with 10 additions and 0 deletions

View File

@@ -124,6 +124,8 @@ int log_vprintf(int level, const char *format, va_list ap)
} else {
buf.append(TERM_RESET);
}
} else {
prune_ansi_sequences_inplace(buf.get());
}
int ret = buf.get().size();
buf.submit();