57 #define SPA_TYPE_INTERFACE_Log SPA_TYPE_INFO_INTERFACE_BASE "Log"
59 #define SPA_VERSION_LOG 0
72 #define SPA_VERSION_LOG_METHODS 0
85 void (*
log) (
void *object,
112 #define spa_log_level_enabled(l,lev) ((l) && (l)->level >= (lev))
114 #if defined(__USE_ISOC11) || defined(__USE_ISOC99) || \
115 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
117 #define spa_log_log(l,lev,...) \
119 struct spa_log *_l = l; \
120 if (SPA_UNLIKELY(spa_log_level_enabled(_l, lev))) \
121 spa_interface_call(&_l->iface, \
122 struct spa_log_methods, log, 0, lev, \
126 #define spa_log_logv(l,lev,...) \
128 struct spa_log *_l = l; \
129 if (SPA_UNLIKELY(spa_log_level_enabled(_l, lev))) \
130 spa_interface_call(&_l->iface, \
131 struct spa_log_methods, logv, 0, lev, \
135 #define spa_log_error(l,...) spa_log_log(l,SPA_LOG_LEVEL_ERROR,__FILE__,__LINE__,__func__,__VA_ARGS__)
136 #define spa_log_warn(l,...) spa_log_log(l,SPA_LOG_LEVEL_WARN,__FILE__,__LINE__,__func__,__VA_ARGS__)
137 #define spa_log_info(l,...) spa_log_log(l,SPA_LOG_LEVEL_INFO,__FILE__,__LINE__,__func__,__VA_ARGS__)
138 #define spa_log_debug(l,...) spa_log_log(l,SPA_LOG_LEVEL_DEBUG,__FILE__,__LINE__,__func__,__VA_ARGS__)
139 #define spa_log_trace(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
142 #define spa_log_trace_fp(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
144 #define spa_log_trace_fp(l,...)
149 #define SPA_LOG_FUNC(name,lev) \
150 inline SPA_PRINTF_FUNC(2,3) void spa_log_##name (struct spa_log *l, const char *format, ...) \
152 if (SPA_UNLIKELY(spa_log_level_enabled(l, lev))) { \
154 va_start (varargs, format); \
155 spa_interface_call(&l->iface, \
156 struct spa_log_methods, logv, 0, lev, \
157 __FILE__,__LINE__,__func__,format,varargs); \
171 inline void spa_log_trace_fp (
struct spa_log *l,
const char *format, ...) { }
177 #define SPA_KEY_LOG_LEVEL "log.level"
178 #define SPA_KEY_LOG_COLORS "log.colors"
179 #define SPA_KEY_LOG_FILE "log.file"
181 #define SPA_KEY_LOG_TIMESTAMP "log.timestamp"
182 #define SPA_KEY_LOG_LINE "log.line"
static uint32_t int int const char va_list args
Definition: core.h:330
spa_log_level
Definition: output/doc/spa/support/log.h:45
#define SPA_LOG_FUNC(name, lev)
Definition: output/doc/spa/support/log.h:149
enum spa_log_level level const char int const char * func
Definition: log-impl.h:46
enum spa_log_level level const char * file
Definition: log-impl.h:43
enum spa_log_level level const char int const char const char * fmt
Definition: log-impl.h:47
enum spa_log_level level const char int line
Definition: log-impl.h:45
@ SPA_LOG_LEVEL_INFO
Definition: output/doc/spa/support/log.h:49
@ SPA_LOG_LEVEL_NONE
Definition: output/doc/spa/support/log.h:46
@ SPA_LOG_LEVEL_TRACE
Definition: output/doc/spa/support/log.h:51
@ SPA_LOG_LEVEL_DEBUG
Definition: output/doc/spa/support/log.h:50
@ SPA_LOG_LEVEL_ERROR
Definition: output/doc/spa/support/log.h:47
@ SPA_LOG_LEVEL_WARN
Definition: output/doc/spa/support/log.h:48
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:203
Definition: output/doc/spa/support/log.h:71
uint32_t version
Definition: output/doc/spa/support/log.h:73
void(*) void(* logv)(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args) SPA_PRINTF_FUNC(6
Log a message with the given log level.
Definition: output/doc/spa/support/log.h:103
void(* log)(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...) SPA_PRINTF_FUNC(6
Log a message with the given log level.
Definition: output/doc/spa/support/log.h:85
Definition: output/doc/spa/support/log.h:61
struct spa_interface iface
the version of this log.
Definition: output/doc/spa/support/log.h:64
enum spa_log_level level
Logging level, everything above this level is not logged.
Definition: output/doc/spa/support/log.h:68