libavutil/log.c File Reference

logging functions More...

#include <unistd.h>
#include <stdlib.h>
#include "avutil.h"
#include "log.h"

Go to the source code of this file.

Defines

#define set_color(x)   fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15)
#define reset_color()   fprintf(stderr, "\033[0m")

Functions

static void colored_fputs (int level, const char *str)
const char * av_default_item_name (void *ptr)
static void sanitize (uint8_t *line)
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.
void av_log_default_callback (void *ptr, int level, const char *fmt, va_list vl)
void av_log (void *avcl, int level, const char *fmt,...)
void av_vlog (void *avcl, int level, const char *fmt, va_list vl)
int av_log_get_level (void)
void av_log_set_level (int level)
void av_log_set_flags (int arg)
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))

Variables

static int av_log_level = AV_LOG_INFO
static int flags
static const uint8_t color [] = { 0x41, 0x41, 0x11, 0x03, 9, 9, 2 }
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.


Define Documentation

#define reset_color ( )    fprintf(stderr, "\033[0m")

Definition at line 45 of file log.c.

Referenced by colored_fputs().

#define set_color (   x)    fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15)

Definition at line 44 of file log.c.

Referenced by colored_fputs().


Function Documentation

const char* av_default_item_name ( void ptr)

Definition at line 82 of file log.c.

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

Definition at line 154 of file log.c.

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

Definition at line 118 of file log.c.

Referenced by log_callback_report().

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.

Parameters:
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1

Definition at line 95 of file log.c.

Referenced by av_log_default_callback(), and log_callback_report().

Definition at line 171 of file log.c.

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

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

Definition at line 186 of file log.c.

Referenced by main(), opt_help(), opt_report(), and opt_version().

void av_log_set_flags ( int  arg)

Definition at line 181 of file log.c.

Referenced by main().

void av_log_set_level ( int  level)

Definition at line 176 of file log.c.

Referenced by main(), opt_codec_debug(), opt_loglevel(), opt_report(), and transcode().

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

Definition at line 166 of file log.c.

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

static void colored_fputs ( int  level,
const char *  str 
) [static]

Definition at line 50 of file log.c.

Referenced by av_log_default_callback().

static void sanitize ( uint8_t *  line) [static]

Definition at line 87 of file log.c.

Referenced by av_log_default_callback().


Variable Documentation

void(* av_log_callback)(void *, int, const char *, va_list) [static]
Initial value:

Definition at line 151 of file log.c.

Referenced by av_log_set_callback(), and av_vlog().

int av_log_level = AV_LOG_INFO [static]

Definition at line 32 of file log.c.

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

int flags [static]

Definition at line 33 of file log.c.

Referenced by av_log_default_callback(), and av_log_set_flags().

int use_color = -1 [static]

Definition at line 47 of file log.c.

Referenced by colored_fputs().