]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/log.c
Merge commit 'bd5ad8b23d0f7d469ca30d03deca879993eb0431'
[ffmpeg] / libavutil / log.c
index 2091316957734a5078cfff578175218969c0c957..b256d0762452ad4b0aa1cc774f318615ddeee034 100644 (file)
@@ -50,6 +50,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 static int av_log_level = AV_LOG_INFO;
 static int flags;
 
+#define NB_LEVELS 8
 #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
 #include <windows.h>
 static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
@@ -60,6 +61,7 @@ static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
     [AV_LOG_INFO   /8] =  7,
     [AV_LOG_VERBOSE/8] = 10,
     [AV_LOG_DEBUG  /8] = 10,
+    [AV_LOG_TRACE  /8] = 8,
     [16+AV_CLASS_CATEGORY_NA              ] =  7,
     [16+AV_CLASS_CATEGORY_INPUT           ] = 13,
     [16+AV_CLASS_CATEGORY_OUTPUT          ] =  5,
@@ -91,6 +93,7 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
     [AV_LOG_INFO   /8] = 253 <<  8 | 0x09,
     [AV_LOG_VERBOSE/8] =  40 <<  8 | 0x02,
     [AV_LOG_DEBUG  /8] =  34 <<  8 | 0x02,
+    [AV_LOG_TRACE  /8] =  34 <<  8 | 0x07,
     [16+AV_CLASS_CATEGORY_NA              ] = 250 << 8 | 0x09,
     [16+AV_CLASS_CATEGORY_INPUT           ] = 219 << 8 | 0x15,
     [16+AV_CLASS_CATEGORY_OUTPUT          ] = 201 << 8 | 0x05,
@@ -328,9 +331,9 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
     sanitize(part[1].str);
     colored_fputs(type[1], 0, part[1].str);
     sanitize(part[2].str);
-    colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[2].str);
+    colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str);
     sanitize(part[3].str);
-    colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[3].str);
+    colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str);
 end:
     av_bprint_finalize(part+3, NULL);
 #if HAVE_PTHREADS