3 * \brief logging functions
5 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
7 * This file was a part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 #define MLT_LOG_QUIET -8
32 * something went really wrong and we will crash now
34 #define MLT_LOG_PANIC 0
37 * something went wrong and recovery is not possible
38 * like no header in a format which depends on it or a combination
39 * of parameters which are not allowed
41 #define MLT_LOG_FATAL 8
44 * something went wrong and cannot losslessly be recovered
45 * but not all future data is affected
47 #define MLT_LOG_ERROR 16
50 * something somehow does not look correct / something which may or may not
51 * lead to some problems
53 #define MLT_LOG_WARNING 24
55 #define MLT_LOG_INFO 32
56 #define MLT_LOG_VERBOSE 40
59 * stuff which is only useful for MLT developers
61 #define MLT_LOG_DEBUG 48
64 * Send the specified message to the log if the level is less than or equal to
65 * the current logging level. By default, all logging messages are sent to
66 * stderr. This behavior can be altered by setting a different mlt_vlog callback
69 * \param service An optional pointer to a \p mlt_service_s.
70 * \param level The importance level of the message, lower values signifying
72 * \param fmt The format string (printf-compatible) that specifies how
73 * subsequent arguments are converted to output.
77 void mlt_log( void *service
, int level
, const char *fmt
, ... ) __attribute__ ((__format__ (__printf__
, 3, 4)));
79 void mlt_log( void *service
, int level
, const char *fmt
, ... );
82 #define mlt_log_panic(service, format, args...) mlt_log((service), MLT_LOG_PANIC, (format), ## args)
83 #define mlt_log_fatal(service, format, args...) mlt_log((service), MLT_LOG_FATAL, (format), ## args)
84 #define mlt_log_error(service, format, args...) mlt_log((service), MLT_LOG_ERROR, (format), ## args)
85 #define mlt_log_warning(service, format, args...) mlt_log((service), MLT_LOG_WARNING, (format), ## args)
86 #define mlt_log_info(service, format, args...) mlt_log((service), MLT_LOG_INFO, (format), ## args)
87 #define mlt_log_verbose(service, format, args...) mlt_log((service), MLT_LOG_VERBOSE, (format), ## args)
88 #define mlt_log_debug(service, format, args...) mlt_log((service), MLT_LOG_DEBUG, (format), ## args)
90 void mlt_vlog( void *service
, int level
, const char *fmt
, va_list );
91 int mlt_log_get_level( void );
92 void mlt_log_set_level( int );
93 void mlt_log_set_callback( void (*)( void*, int, const char*, va_list ) );
95 #endif /* MLT_LOG_H */