Libav
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 
75 
79  void* (*child_next)(void *obj, void *prev);
80 
89  const struct AVClass* (*child_class_next)(const struct AVClass *prev);
90 } AVClass;
91 
105 #define AV_LOG_QUIET -8
106 
110 #define AV_LOG_PANIC 0
111 
117 #define AV_LOG_FATAL 8
118 
123 #define AV_LOG_ERROR 16
124 
129 #define AV_LOG_WARNING 24
130 
134 #define AV_LOG_INFO 32
135 
139 #define AV_LOG_VERBOSE 40
140 
144 #define AV_LOG_DEBUG 48
145 
164 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
165 
166 
182 void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
183 
191 int av_log_get_level(void);
192 
200 void av_log_set_level(int level);
201 
209 void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
210 
224 void av_log_default_callback(void *avcl, int level, const char *fmt,
225  va_list vl);
226 
234 const char* av_default_item_name(void* ctx);
235 
241 #ifdef DEBUG
242 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
243 #else
244 # define av_dlog(pctx, ...)
245 #endif
246 
255 #define AV_LOG_SKIP_REPEATED 1
256 void av_log_set_flags(int arg);
257 
262 #endif /* AVUTIL_LOG_H */