* commit 'c253340ae6f74ffd8798bbd476e46d1b33a2d56e': log: Introduce a more verbose debug level Conflicts: doc/APIchanges doc/fftools-common-opts.texi libavutil/log.c libavutil/version.h
Unified · Split
| @@ -845,6 +845,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 844 unmodified lines | ||
| 845 | 845 | { "info" , AV_LOG_INFO }, |
| 846 | 846 | { "verbose", AV_LOG_VERBOSE }, |
| 847 | 847 | { "debug" , AV_LOG_DEBUG }, |
| 848 | + { "trace" , AV_LOG_TRACE }, | |
| 848 | 849 | }; |
| 849 | 850 | char *tail; |
| 850 | 851 | int level; |
| @@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | API changes, most recent first: |
| 17 | 17 | |
| 18 | +2015-xx-xx - xxxxxxx - lavu 54.12.0 | |
| 19 | + Add AV_LOG_TRACE for extremely verbose debugging. | |
| 20 | + | |
| 18 | 21 | 2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h |
| 19 | 22 | Add AVIODirEntryType.AVIO_ENTRY_SERVER. |
| 20 | 23 | Add AVIODirEntryType.AVIO_ENTRY_SHARE. |
| @@ -190,6 +190,7 @@ warnings and errors. This is the default value. · 189 unmodified lines | ||
| 190 | 190 | Same as @code{info}, except more verbose. |
| 191 | 191 | @item debug, 48 |
| 192 | 192 | Show everything, including debugging information. |
| 193 | +@item trace, 56 | |
| 193 | 194 | @end table |
| 194 | 195 | |
| 195 | 196 | By default the program logs to stderr, if coloring is supported by the |
| @@ -50,6 +50,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; · 49 unmodified lines | ||
| 50 | 50 | static int av_log_level = AV_LOG_INFO; |
| 51 | 51 | static int flags; |
| 52 | 52 | |
| 53 | +#define NB_LEVELS 8 | |
| 53 | 54 | #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE |
| 54 | 55 | #include <windows.h> |
| 55 | 56 | static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { |
| @@ -60,6 +61,7 @@ static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { · 4 unmodified lines | ||
| 60 | 61 | [AV_LOG_INFO /8] = 7, |
| 61 | 62 | [AV_LOG_VERBOSE/8] = 10, |
| 62 | 63 | [AV_LOG_DEBUG /8] = 10, |
| 64 | + [AV_LOG_TRACE /8] = 8, | |
| 63 | 65 | [16+AV_CLASS_CATEGORY_NA ] = 7, |
| 64 | 66 | [16+AV_CLASS_CATEGORY_INPUT ] = 13, |
| 65 | 67 | [16+AV_CLASS_CATEGORY_OUTPUT ] = 5, |
| @@ -91,6 +93,7 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = { · 25 unmodified lines | ||
| 91 | 93 | [AV_LOG_INFO /8] = 253 << 8 | 0x09, |
| 92 | 94 | [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02, |
| 93 | 95 | [AV_LOG_DEBUG /8] = 34 << 8 | 0x02, |
| 96 | + [AV_LOG_TRACE /8] = 34 << 8 | 0x07, | |
| 94 | 97 | [16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09, |
| 95 | 98 | [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15, |
| 96 | 99 | [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) · 231 unmodified lines | ||
| 328 | 331 | sanitize(part[1].str); |
| 329 | 332 | colored_fputs(type[1], 0, part[1].str); |
| 330 | 333 | sanitize(part[2].str); |
| 331 | − colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[2].str); | |
| 334 | + colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str); | |
| 332 | 335 | sanitize(part[3].str); |
| 333 | − colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[3].str); | |
| 336 | + colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str); | |
| 334 | 337 | end: |
| 335 | 338 | av_bprint_finalize(part+3, NULL); |
| 336 | 339 | #if HAVE_PTHREADS |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | #include <stdarg.h> |
| 25 | 25 | #include "avutil.h" |
| 26 | 26 | #include "attributes.h" |
| 27 | +#include "version.h" | |
| 27 | 28 | |
| 28 | 29 | typedef enum { |
| 29 | 30 | AV_CLASS_CATEGORY_NA = 0, |
| @@ -197,6 +198,11 @@ typedef struct AVClass { · 167 unmodified lines | ||
| 197 | 198 | |
| 198 | 199 | #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET) |
| 199 | 200 | |
| 201 | +/** | |
| 202 | + * Extremely verbose debugging, useful for libav* development. | |
| 203 | + */ | |
| 204 | +#define AV_LOG_TRACE 56 | |
| 205 | + | |
| 200 | 206 | /** |
| 201 | 207 | * @} |
| 202 | 208 | */ |
| @@ -311,8 +317,10 @@ AVClassCategory av_default_get_category(void *ptr); · 108 unmodified lines | ||
| 311 | 317 | void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, |
| 312 | 318 | char *line, int line_size, int *print_prefix); |
| 313 | 319 | |
| 320 | +#if FF_API_DLOG | |
| 314 | 321 | /** |
| 315 | 322 | * av_dlog macros |
| 323 | + * @deprecated unused | |
| 316 | 324 | * Useful to print debug messages that shouldn't get compiled in normally. |
| 317 | 325 | */ |
| 318 | 326 | |
| @@ -321,6 +329,7 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, · 2 unmodified lines | ||
| 321 | 329 | #else |
| 322 | 330 | # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) |
| 323 | 331 | #endif |
| 332 | +#endif /* FF_API_DLOG */ | |
| 324 | 333 | |
| 325 | 334 | /** |
| 326 | 335 | * Skip repeated messages, this requires the user app to use av_log() instead of |
| @@ -56,8 +56,8 @@ · 55 unmodified lines | ||
| 56 | 56 | */ |
| 57 | 57 | |
| 58 | 58 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 59 | −#define LIBAVUTIL_VERSION_MINOR 22 | |
| 60 | −#define LIBAVUTIL_VERSION_MICRO 101 | |
| 59 | +#define LIBAVUTIL_VERSION_MINOR 23 | |
| 60 | +#define LIBAVUTIL_VERSION_MICRO 100 | |
| 61 | 61 | |
| 62 | 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 63 | 63 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -119,6 +119,9 @@ · 55 unmodified lines | ||
| 119 | 119 | #ifndef FF_API_OPT_TYPE_METADATA |
| 120 | 120 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) |
| 121 | 121 | #endif |
| 122 | +#ifndef FF_API_DLOG | |
| 123 | +#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | |
| 124 | +#endif | |
| 122 | 125 | |
| 123 | 126 | #ifndef FF_CONST_AVUTIL55 |
| 124 | 127 | #if LIBAVUTIL_VERSION_MAJOR >= 55 |