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 
33 typedef struct AVClass {
38  const char* class_name;
39 
44  const char* (*item_name)(void* ctx);
45 
51  const struct AVOption *option;
52 
59  int version;
60 
66 
74 
78  void* (*child_next)(void *obj, void *prev);
79 
88  const struct AVClass* (*child_class_next)(const struct AVClass *prev);
89 } AVClass;
90 
91 /* av_log API */
92 
93 #define AV_LOG_QUIET -8
94 
98 #define AV_LOG_PANIC 0
99 
105 #define AV_LOG_FATAL 8
106 
111 #define AV_LOG_ERROR 16
112 
117 #define AV_LOG_WARNING 24
118 
119 #define AV_LOG_INFO 32
120 #define AV_LOG_VERBOSE 40
121 
125 #define AV_LOG_DEBUG 48
126 
141 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
142 
143 void av_vlog(void *avcl, int level, const char *fmt, va_list);
144 int av_log_get_level(void);
145 void av_log_set_level(int);
146 void av_log_set_callback(void (*)(void*, int, const char*, va_list));
147 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
148 const char* av_default_item_name(void* ctx);
149 
155 #ifdef DEBUG
156 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
157 #else
158 # define av_dlog(pctx, ...)
159 #endif
160 
169 #define AV_LOG_SKIP_REPEATED 1
170 void av_log_set_flags(int arg);
171 
172 #endif /* AVUTIL_LOG_H */