Libav
Modules | Macros | Functions
Logging Facility

Modules

 Logging Constants
 

Macros

#define av_dlog(pctx,...)
 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally. More...
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck. More...
 

Functions

void av_log (void *avcl, int level, const char *fmt,...) av_printf_format(3
 Send the specified message to the log if the level is less than or equal to the current av_log_level. More...
 
void void av_vlog (void *avcl, int level, const char *fmt, va_list vl)
 Send the specified message to the log if the level is less than or equal to the current av_log_level. More...
 
int av_log_get_level (void)
 Get the current log level. More...
 
void av_log_set_level (int level)
 Set the log level. More...
 
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))
 Set the logging callback. More...
 
void av_log_default_callback (void *avcl, int level, const char *fmt, va_list vl)
 Default logging callback. More...
 
const char * av_default_item_name (void *ctx)
 Return the context name. More...
 
void av_log_set_flags (int arg)
 

Detailed Description

Macro Definition Documentation

#define av_dlog (   pctx,
  ... 
)

av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 244 of file log.h.

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, ""); at the end

Definition at line 255 of file log.h.

Referenced by av_log_default_callback(), and main().

Function Documentation

void av_log ( void avcl,
int  level,
const char *  fmt,
  ... 
)

Send the specified message to the log if the level is less than or equal to the current av_log_level.

By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function.

See also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
void void av_vlog ( void avcl,
int  level,
const char *  fmt,
va_list  vl 
)

Send the specified message to the log if the level is less than or equal to the current av_log_level.

By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function.

See also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string.

Definition at line 160 of file log.c.

Referenced by av_log(), av_log_ask_for_sample(), missing_feature_sample(), rtmp_log(), X264_log(), and XAVS_log().

int av_log_get_level ( void  )

Get the current log level.

See also
Logging Constants
Returns
Current log level

Definition at line 165 of file log.c.

Referenced by avcodec_string(), hex_log(), http_av_log(), and rtmp_open().

void av_log_set_level ( int  level)

Set the log level.

See also
Logging Constants
Parameters
levelLogging level

Definition at line 170 of file log.c.

Referenced by main(), and opt_loglevel().

void av_log_set_callback ( void(*)(void *, int, const char *, va_list)  callback)

Set the logging callback.

See also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature.

Definition at line 180 of file log.c.

Referenced by main(), show_help(), show_help_default(), and show_version().

void av_log_default_callback ( void avcl,
int  level,
const char *  fmt,
va_list  vl 
)

Default logging callback.

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string.

Definition at line 97 of file log.c.

const char* av_default_item_name ( void ctx)

Return the context name.

Parameters
ctxThe AVClass context
Returns
The AVClass class_name

Definition at line 92 of file log.c.

void av_log_set_flags ( int  arg)

Definition at line 175 of file log.c.

Referenced by main().