Go to the documentation of this file.
58 #define SPA_TYPE_INTERFACE_Log SPA_TYPE_INFO_INTERFACE_BASE "Log"
64 #define SPA_VERSION_LOG 0
73 #define SPA_VERSION_LOG_METHODS 0
86 void (*
log) (
void *object,
113 #define spa_log_level_enabled(l,lev) ((l) && (l)->level >= (lev))
115 #if defined(__USE_ISOC11) || defined(__USE_ISOC99) || \
116 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
118 #define spa_log_log(l,lev,...) \
120 struct spa_log *_l = l; \
121 if (SPA_UNLIKELY(spa_log_level_enabled(_l, lev))) \
122 spa_interface_call(&_l->iface, \
123 struct spa_log_methods, log, 0, lev, \
127 #define spa_log_logv(l,lev,...) \
129 struct spa_log *_l = l; \
130 if (SPA_UNLIKELY(spa_log_level_enabled(_l, lev))) \
131 spa_interface_call(&_l->iface, \
132 struct spa_log_methods, logv, 0, lev, \
136 #define spa_log_error(l,...) spa_log_log(l,SPA_LOG_LEVEL_ERROR,__FILE__,__LINE__,__func__,__VA_ARGS__)
137 #define spa_log_warn(l,...) spa_log_log(l,SPA_LOG_LEVEL_WARN,__FILE__,__LINE__,__func__,__VA_ARGS__)
138 #define spa_log_info(l,...) spa_log_log(l,SPA_LOG_LEVEL_INFO,__FILE__,__LINE__,__func__,__VA_ARGS__)
139 #define spa_log_debug(l,...) spa_log_log(l,SPA_LOG_LEVEL_DEBUG,__FILE__,__LINE__,__func__,__VA_ARGS__)
140 #define spa_log_trace(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
143 #define spa_log_trace_fp(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
145 #define spa_log_trace_fp(l,...)
150 #define SPA_LOG_FUNC(name,lev) \
151 inline SPA_PRINTF_FUNC(2,3) void spa_log_##name (struct spa_log *l, const char *format, ...) \
153 if (SPA_UNLIKELY(spa_log_level_enabled(l, lev))) { \
155 va_start (varargs, format); \
156 spa_interface_call(&l->iface, \
157 struct spa_log_methods, logv, 0, lev, \
158 __FILE__,__LINE__,__func__,format,varargs); \
180 #define SPA_KEY_LOG_LEVEL "log.level"
181 #define SPA_KEY_LOG_COLORS "log.colors"
182 #define SPA_KEY_LOG_FILE "log.file"
184 #define SPA_KEY_LOG_TIMESTAMP "log.timestamp"
185 #define SPA_KEY_LOG_LINE "log.line"
spa_log_level
Definition: build-12683127/doc/spa/support/log.h:46
uint32_t version
Definition: build-12683127/doc/spa/support/log.h:74
@ SPA_LOG_LEVEL_WARN
Definition: build-12683127/doc/spa/support/log.h:49
struct spa_interface iface
Definition: build-12683127/doc/spa/support/log.h:65
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:205
Definition: build-12683127/doc/spa/support/log.h:61
enum spa_log_level level
Logging level, everything above this level is not logged.
Definition: build-12683127/doc/spa/support/log.h:69
@ SPA_LOG_LEVEL_DEBUG
Definition: build-12683127/doc/spa/support/log.h:51
@ SPA_LOG_LEVEL_ERROR
Definition: build-12683127/doc/spa/support/log.h:48
#define spa_log_trace_fp(l,...)
Definition: build-12683127/doc/spa/support/log.h:143
void(* log)(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...) 1(6
Log a message with the given log level.
Definition: build-12683127/doc/spa/support/log.h:86
@ SPA_LOG_LEVEL_INFO
Definition: build-12683127/doc/spa/support/log.h:50
@ SPA_LOG_LEVEL_TRACE
Definition: build-12683127/doc/spa/support/log.h:52
@ SPA_LOG_LEVEL_NONE
Definition: build-12683127/doc/spa/support/log.h:47
void(*) void(* logv)(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args) 1(6
Log a message with the given log level.
Definition: build-12683127/doc/spa/support/log.h:104
Definition: build-12683127/doc/spa/support/log.h:72