All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
log.c File Reference

logging functions More...

#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include "avutil.h"
#include "bprint.h"
#include "common.h"
#include "internal.h"
#include "log.h"
#include "thread.h"

Go to the source code of this file.


#define LINE_SZ   1024
#define NB_LEVELS   8


static void check_color_terminal (void)
static void colored_fputs (int level, int tint, const char *str)
const char * av_default_item_name (void *ptr)
 Return the context name. More...
AVClassCategory av_default_get_category (void *ptr)
static void sanitize (uint8_t *line)
static int get_category (void *ptr)
static const char * get_level_str (int level)
static void format_line (void *avcl, int level, const char *fmt, va_list vl, AVBPrint part[4], int *print_prefix, int type[2])
void av_log_format_line (void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix)
 Format a line of log the same way as the default callback. More...
int av_log_format_line2 (void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix)
 Format a line of log the same way as the default callback. More...
void av_log_default_callback (void *ptr, int level, const char *fmt, va_list vl)
 Default logging callback. More...
void av_log (void *avcl, int level, const char *fmt,...)
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_flags (int arg)
int av_log_get_flags (void)
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))
 Set the logging callback. More...
static void missing_feature_sample (int sample, void *avc, const char *msg, va_list argument_list)
void avpriv_request_sample (void *avc, const char *msg,...)
void avpriv_report_missing_feature (void *avc, const char *msg,...)


static AVMutex mutex = AV_MUTEX_INITIALIZER
static int av_log_level = AV_LOG_INFO
static int flags
static const uint32_t color [16+AV_CLASS_CATEGORY_NB]
static int use_color = -1
static void(* av_log_callback )(void *, int, const char *, va_list)

Detailed Description

logging functions

Definition in file log.c.

Macro Definition Documentation

#define LINE_SZ   1024

Definition at line 46 of file log.c.

Referenced by av_log_default_callback().

#define NB_LEVELS   8

Definition at line 57 of file log.c.

Referenced by av_log_default_callback().

Function Documentation

static void check_color_terminal ( void  )

Definition at line 123 of file log.c.

Referenced by colored_fputs().

static void colored_fputs ( int  level,
int  tint,
const char *  str 

Definition at line 148 of file log.c.

Referenced by av_log_default_callback().

static void sanitize ( uint8_t line)

Definition at line 201 of file log.c.

Referenced by av_log_default_callback().

static int get_category ( void ptr)

Definition at line 209 of file log.c.

Referenced by format_line().

static const char* get_level_str ( int  level)

Definition at line 222 of file log.c.

Referenced by format_line().

static void format_line ( void avcl,
int  level,
const char *  fmt,
va_list  vl,
AVBPrint  part[4],
int print_prefix,
int  type[2] 

Definition at line 246 of file log.c.

Referenced by av_log_default_callback(), and av_log_format_line2().

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

Definition at line 361 of file log.c.

Referenced by main(), and missing_feature_sample().

static void missing_feature_sample ( int  sample,
void avc,
const char *  msg,
va_list  argument_list 

Definition at line 405 of file log.c.

Referenced by avpriv_report_missing_feature(), and avpriv_request_sample().

void avpriv_request_sample ( void avc,
const char *  msg,

Definition at line 419 of file log.c.

void avpriv_report_missing_feature ( void avc,
const char *  msg,

Definition at line 428 of file log.c.

Variable Documentation


Definition at line 44 of file log.c.

Referenced by av_log_default_callback().

int av_log_level = AV_LOG_INFO

Definition at line 54 of file log.c.

Referenced by av_log_default_callback(), av_log_get_level(), and av_log_set_level().

int flags

Definition at line 55 of file log.c.

Referenced by add_index_entry(), ape_tag_read_field(), apply_param_change(), asf_read_stream_properties(), asf_write_packet(), av_get_cpu_flags(), av_log_default_callback(), av_log_get_flags(), av_log_set_flags(), av_opt_query_ranges(), av_opt_set_defaults2(), av_parse_cpu_flags(), av_read_image_line(), av_timecode_init(), av_vdpau_bind_context(), av_write_image_line(), avfilter_graph_queue_command(), avfilter_graph_set_auto_convert(), avi_add_ientry(), avi_read_idx1(), avi_write_header(), avi_write_packet_internal(), avio_check(), bidir_refine(), check(), crypto_open2(), decode_frame(), decode_frame_header(), decode_header(), decode_hextile(), decode_init(), decode_mb_b(), decode_rle(), decode_subblock(), decode_subblock3(), device_open(), dnxhd_decode_dct_block(), dump_paramchange(), dump_stream_format(), dxa_read_header(), encode_codebook(), encode_frame(), encode_mode(), epzs_motion_search2(), epzs_motion_search4(), fbdev_read_header(), fbdev_write_header(), ff_ac3_apply_rematrixing(), ff_add_index_entry(), ff_alsa_open(), ff_draw_init(), ff_get_cpu_max_align_aarch64(), ff_get_cpu_max_align_ppc(), ff_get_cpu_max_align_x86(), ff_get_unscaled_swscale(), ff_mediacodec_dec_decode(), ff_mms_asf_header_parser(), ff_mp4_parse_es_descr(), ff_rdt_parse_packet(), ffat_init_encoder(), fileTest(), filter_codec_opts(), filter_frame(), find_prev_closest_index(), flush(), flv_read_header(), flv_read_packet(), flv_write_packet(), format_line(), gdv_decode_frame(), get_audio_flags(), get_mb_score(), get_needed_flags(), get_opt_flags_string(), gif_read_image(), hls_read_seek(), hpel_motion_search(), init_context_defaults(), init_noise(), ipvideo_decode_block_opcode_0x7(), ipvideo_decode_block_opcode_0x7_16(), ipvideo_decode_block_opcode_0x8(), ipvideo_decode_block_opcode_0x8_16(), ipvideo_decode_block_opcode_0x9(), ipvideo_decode_block_opcode_0x9_16(), ipvideo_decode_block_opcode_0xA(), ipvideo_decode_block_opcode_0xA_16(), is_animated_webp_packet(), lvf_read_packet(), magy_decode_slice(), magy_decode_slice10(), main(), matroska_parse_block(), matroska_parse_wavpack(), mjpeg_decode_app(), mkv_write_vtt_blocks(), mov_fix_index(), mov_parse_stsd_audio(), mov_read_saiz(), mov_read_tfhd(), mov_read_timecode_track(), mov_read_tkhd(), mov_read_trun(), mov_write_tfhd_tag(), mov_write_tkhd_tag(), mov_write_trun_tag(), mpeg_decode_user_data(), mpegps_read_pes_header(), mpegts_push_data(), mpegts_write_pes(), mpegts_write_section1(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), mxf_compute_ptses_fake_index(), mxf_parse_physical_source_package(), mxf_parse_structural_metadata(), noise(), nut_write_packet(), nvenc_check_capabilities(), ogg_read_page(), old_codec37(), opt_cpuflags(), opt_loglevel(), parse_MP4SLDescrTag(), parse_opus_ts_header(), parse_pcr(), parse_pixel_format(), pmp_header(), pp_config_props(), process_command(), qpel_motion_search(), read_desc_chunk(), read_header(), read_moof_duration(), read_packet(), read_part_of_packet(), read_trun_duration(), rm_read_dts(), rm_read_header(), rm_read_packet(), rtp_parse_one_packet(), rtp_parse_packet_internal(), rtp_resolve_host(), rv10_write_header(), sdl2_write_header(), sdr2_read_packet(), selfTest(), seqvideo_decode(), show_help_default(), smacker_read_packet(), sws_alloc_set_opts(), sws_getCachedContext(), sws_init_context(), swscale(), thread_get_buffer_internal(), thread_main(), txd_decode_frame(), udp_resolve_host(), url_alloc_for_protocol(), vaapi_map_frame(), validate_avframe_allocation(), vmdaudio_decode_frame(), vorbis_packet(), wmavoice_decode_init(), write_header(), write_sm_data(), and wv_read_block_header().

const uint32_t color[16+AV_CLASS_CATEGORY_NB]
Initial value:
= {
[AV_LOG_PANIC /8] = 52 << 16 | 196 << 8 | 0x41,
[AV_LOG_FATAL /8] = 208 << 8 | 0x41,
[AV_LOG_ERROR /8] = 196 << 8 | 0x11,
[AV_LOG_WARNING/8] = 226 << 8 | 0x03,
[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,
[16+AV_CLASS_CATEGORY_MUXER ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEMUXER ] = 207 << 8 | 0x05,
[16+AV_CLASS_CATEGORY_ENCODER ] = 51 << 8 | 0x16,
[16+AV_CLASS_CATEGORY_DECODER ] = 39 << 8 | 0x06,
[16+AV_CLASS_CATEGORY_FILTER ] = 155 << 8 | 0x12,
[16+AV_CLASS_CATEGORY_SWSCALER ] = 153 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 147 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 207 << 8 | 0x05,
Something somehow does not look correct.
Definition: log.h:182
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
Definition: log.h:163
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:202
Detailed information.
Definition: log.h:192
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:197
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition: log.h:170

Definition at line 92 of file log.c.

Referenced by av_get_known_color_name(), cdg_load_palette(), cdg_scroll(), cdg_tile_block(), color_get(), color_inc(), config_input(), config_output(), config_props(), copy_color_mask(), create_cv_pixel_buffer(), decode_format80(), decode_hextile(), decode_rle(), draw_curves(), draw_line(), dvb_encode_rle2(), dvb_encode_rle4(), dvb_encode_rle8(), dvd_encode_rle(), ff_fill_rectangle(), ff_htmlmarkup_to_ass(), ff_snow_pred_block(), fill_frame(), guess_dc(), main(), mm_decode_inter(), mm_decode_intra(), modplug_read_packet(), mp_get_yuv_from_rgb(), mp_set_rgb_from_yuv(), overlay_ass_image(), plot_freqs(), rle_decode(), select_palette(), set_frame(), and test_av_get_known_color_name().

int use_color = -1

Definition at line 121 of file log.c.

Referenced by check_color_terminal(), color_printf(), colored_fputs(), and main().

void(* av_log_callback)(void *, int, const char *, va_list)
Initial value:
void av_log_default_callback(void *ptr, int level, const char *fmt, va_list vl)
Default logging callback.
Definition: log.c:300

Definition at line 358 of file log.c.

Referenced by av_log_set_callback(), and av_vlog().