* commit 'c253340ae6f74ffd8798bbd476e46d1b33a2d56e': log: Introduce a more verbose debug level Conflicts: doc/APIchanges doc/fftools-common-opts.texi libavutil/log.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n2.7
@@ -845,6 +845,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) | |||||
{ "info" , AV_LOG_INFO }, | { "info" , AV_LOG_INFO }, | ||||
{ "verbose", AV_LOG_VERBOSE }, | { "verbose", AV_LOG_VERBOSE }, | ||||
{ "debug" , AV_LOG_DEBUG }, | { "debug" , AV_LOG_DEBUG }, | ||||
{ "trace" , AV_LOG_TRACE }, | |||||
}; | }; | ||||
char *tail; | char *tail; | ||||
int level; | int level; | ||||
@@ -15,6 +15,9 @@ libavutil: 2014-08-09 | |||||
API changes, most recent first: | API changes, most recent first: | ||||
2015-xx-xx - xxxxxxx - lavu 54.12.0 | |||||
Add AV_LOG_TRACE for extremely verbose debugging. | |||||
2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h | 2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h | ||||
Add AVIODirEntryType.AVIO_ENTRY_SERVER. | Add AVIODirEntryType.AVIO_ENTRY_SERVER. | ||||
Add AVIODirEntryType.AVIO_ENTRY_SHARE. | Add AVIODirEntryType.AVIO_ENTRY_SHARE. | ||||
@@ -190,6 +190,7 @@ warnings and errors. This is the default value. | |||||
Same as @code{info}, except more verbose. | Same as @code{info}, except more verbose. | ||||
@item debug, 48 | @item debug, 48 | ||||
Show everything, including debugging information. | Show everything, including debugging information. | ||||
@item trace, 56 | |||||
@end table | @end table | ||||
By default the program logs to stderr, if coloring is supported by the | 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; | |||||
static int av_log_level = AV_LOG_INFO; | static int av_log_level = AV_LOG_INFO; | ||||
static int flags; | static int flags; | ||||
#define NB_LEVELS 8 | |||||
#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE | #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE | ||||
#include <windows.h> | #include <windows.h> | ||||
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { | 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_INFO /8] = 7, | ||||
[AV_LOG_VERBOSE/8] = 10, | [AV_LOG_VERBOSE/8] = 10, | ||||
[AV_LOG_DEBUG /8] = 10, | [AV_LOG_DEBUG /8] = 10, | ||||
[AV_LOG_TRACE /8] = 8, | |||||
[16+AV_CLASS_CATEGORY_NA ] = 7, | [16+AV_CLASS_CATEGORY_NA ] = 7, | ||||
[16+AV_CLASS_CATEGORY_INPUT ] = 13, | [16+AV_CLASS_CATEGORY_INPUT ] = 13, | ||||
[16+AV_CLASS_CATEGORY_OUTPUT ] = 5, | [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_INFO /8] = 253 << 8 | 0x09, | ||||
[AV_LOG_VERBOSE/8] = 40 << 8 | 0x02, | [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02, | ||||
[AV_LOG_DEBUG /8] = 34 << 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_NA ] = 250 << 8 | 0x09, | ||||
[16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15, | [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15, | ||||
[16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05, | [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); | sanitize(part[1].str); | ||||
colored_fputs(type[1], 0, part[1].str); | colored_fputs(type[1], 0, part[1].str); | ||||
sanitize(part[2].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); | 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: | end: | ||||
av_bprint_finalize(part+3, NULL); | av_bprint_finalize(part+3, NULL); | ||||
#if HAVE_PTHREADS | #if HAVE_PTHREADS | ||||
@@ -24,6 +24,7 @@ | |||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include "avutil.h" | #include "avutil.h" | ||||
#include "attributes.h" | #include "attributes.h" | ||||
#include "version.h" | |||||
typedef enum { | typedef enum { | ||||
AV_CLASS_CATEGORY_NA = 0, | AV_CLASS_CATEGORY_NA = 0, | ||||
@@ -197,6 +198,11 @@ typedef struct AVClass { | |||||
#define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET) | #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET) | ||||
/** | |||||
* Extremely verbose debugging, useful for libav* development. | |||||
*/ | |||||
#define AV_LOG_TRACE 56 | |||||
/** | /** | ||||
* @} | * @} | ||||
*/ | */ | ||||
@@ -311,8 +317,10 @@ AVClassCategory av_default_get_category(void *ptr); | |||||
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, | void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, | ||||
char *line, int line_size, int *print_prefix); | char *line, int line_size, int *print_prefix); | ||||
#if FF_API_DLOG | |||||
/** | /** | ||||
* av_dlog macros | * av_dlog macros | ||||
* @deprecated unused | |||||
* Useful to print debug messages that shouldn't get compiled in normally. | * Useful to print debug messages that shouldn't get compiled in normally. | ||||
*/ | */ | ||||
@@ -321,6 +329,7 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, | |||||
#else | #else | ||||
# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) | # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) | ||||
#endif | #endif | ||||
#endif /* FF_API_DLOG */ | |||||
/** | /** | ||||
* Skip repeated messages, this requires the user app to use av_log() instead of | * Skip repeated messages, this requires the user app to use av_log() instead of | ||||
@@ -56,8 +56,8 @@ | |||||
*/ | */ | ||||
#define LIBAVUTIL_VERSION_MAJOR 54 | #define LIBAVUTIL_VERSION_MAJOR 54 | ||||
#define LIBAVUTIL_VERSION_MINOR 22 | |||||
#define LIBAVUTIL_VERSION_MICRO 101 | |||||
#define LIBAVUTIL_VERSION_MINOR 23 | |||||
#define LIBAVUTIL_VERSION_MICRO 100 | |||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | ||||
LIBAVUTIL_VERSION_MINOR, \ | LIBAVUTIL_VERSION_MINOR, \ | ||||
@@ -119,6 +119,9 @@ | |||||
#ifndef FF_API_OPT_TYPE_METADATA | #ifndef FF_API_OPT_TYPE_METADATA | ||||
#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) | ||||
#endif | #endif | ||||
#ifndef FF_API_DLOG | |||||
#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | |||||
#endif | |||||
#ifndef FF_CONST_AVUTIL55 | #ifndef FF_CONST_AVUTIL55 | ||||
#if LIBAVUTIL_VERSION_MAJOR >= 55 | #if LIBAVUTIL_VERSION_MAJOR >= 55 | ||||