log.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVUTIL_LOG_H
22 #define AVUTIL_LOG_H
23 
24 #include <stdarg.h>
25 #include "avutil.h"
26 #include "attributes.h"
27 #include "version.h"
28 
34 typedef struct AVClass {
39  const char* class_name;
40 
45  const char* (*item_name)(void* ctx);
46 
52  const struct AVOption *option;
53 
60  int version;
61 
67 
76 
80  void* (*child_next)(void *obj, void *prev);
81 
90  const struct AVClass* (*child_class_next)(const struct AVClass *prev);
91 } AVClass;
92 
106 #define AV_LOG_QUIET -8
107 
111 #define AV_LOG_PANIC 0
112 
118 #define AV_LOG_FATAL 8
119 
124 #define AV_LOG_ERROR 16
125 
130 #define AV_LOG_WARNING 24
131 
135 #define AV_LOG_INFO 32
136 
140 #define AV_LOG_VERBOSE 40
141 
145 #define AV_LOG_DEBUG 48
146 
150 #define AV_LOG_TRACE 56
151 
164 #define AV_LOG_C(x) (x << 8)
165 
180 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
181 
182 
198 void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
199 
207 int av_log_get_level(void);
208 
216 void av_log_set_level(int level);
217 
225 void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
226 
240 void av_log_default_callback(void *avcl, int level, const char *fmt,
241  va_list vl);
242 
250 const char* av_default_item_name(void* ctx);
251 
260 #define AV_LOG_SKIP_REPEATED 1
261 void av_log_set_flags(int arg);
262 
267 #endif /* AVUTIL_LOG_H */
AVOption.
Definition: opt.h:234
void av_log_set_level(int level)
Set the log level.
const char * av_default_item_name(void *ctx)
Return the context name.
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...
external API header
Macro definitions for various function/variable attributes.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:39
const struct AVOption * option
a pointer to the first option specified in the class if any or NULL
Definition: log.h:52
int log_level_offset_offset
Offset in the structure where log_level_offset is stored.
Definition: log.h:66
int av_log_get_level(void)
Get the current log level.
Libavutil version macros.
void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl)
Default logging callback.
#define av_printf_format(fmtpos, attrpos)
Definition: attributes.h:117
void av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
Describe the class of an AVClass context structure.
Definition: log.h:34
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...
int version
LIBAVUTIL_VERSION with which this structure was created.
Definition: log.h:60
int parent_log_context_offset
Offset in the structure where a pointer to the parent context for logging is stored.
Definition: log.h:75
void av_log_set_flags(int arg)