From c253340ae6f74ffd8798bbd476e46d1b33a2d56e Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Mon, 16 Mar 2015 08:57:34 +0000 Subject: log: Introduce a more verbose debug level And deprecate av_dlog macro. --- libavutil/log.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libavutil/log.c') diff --git a/libavutil/log.c b/libavutil/log.c index d38e40bfda..7f2cb08597 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -43,16 +43,19 @@ static int av_log_level = AV_LOG_INFO; static int flags; +#define NB_LEVELS 8 #if HAVE_SETCONSOLETEXTATTRIBUTE #include -static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 }; +static const uint8_t color[NB_LEVELS] = { 12, 12, 12, 14, 7, 10, 11, 8}; static int16_t background, attr_orig; static HANDLE con; #define set_color(x) SetConsoleTextAttribute(con, background | color[x]) #define reset_color() SetConsoleTextAttribute(con, attr_orig) #define print_256color(x) #else -static const uint8_t color[] = { 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06 }; +static const uint8_t color[NB_LEVELS] = { + 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06, 0x07 +}; #define set_color(x) fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15) #define print_256color(x) fprintf(stderr, "\033[38;5;%dm", x) #define reset_color() fprintf(stderr, "\033[0m") @@ -159,7 +162,7 @@ void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl) fprintf(stderr, " Last message repeated %d times\n", count); count = 0; } - colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, line); + colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, line); av_strlcpy(prev, line, sizeof line); } -- cgit v1.2.3