25 #ifndef PIPEWIRE_LOG_H
26 #define PIPEWIRE_LOG_H
28 #include <spa/support/log.h>
62 int line,
const char *func,
63 const char *fmt, ...) SPA_PRINTF_FUNC(5, 6);
69 int line, const
char *func,
70 const
char *fmt, va_list
args) SPA_PRINTF_FUNC(5, 0);
74 #define pw_log_level_enabled(lev) (pw_log_level >= (lev))
76 #define pw_log(lev,...) \
78 if (SPA_UNLIKELY(pw_log_level_enabled (lev))) \
79 pw_log_log(lev,__FILE__,__LINE__,__func__,__VA_ARGS__); \
82 #define pw_log_error(...) pw_log(SPA_LOG_LEVEL_ERROR,__VA_ARGS__)
83 #define pw_log_warn(...) pw_log(SPA_LOG_LEVEL_WARN,__VA_ARGS__)
84 #define pw_log_info(...) pw_log(SPA_LOG_LEVEL_INFO,__VA_ARGS__)
85 #define pw_log_debug(...) pw_log(SPA_LOG_LEVEL_DEBUG,__VA_ARGS__)
86 #define pw_log_trace(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
89 #define pw_log_trace_fp(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
91 #define pw_log_trace_fp(...)
SPA_EXPORT void pw_log_set_level(enum spa_log_level level)
Set the global log level.
Definition: log.c:74
SPA_EXPORT void pw_log_log(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...)
Log a message.
Definition: log.c:92
SPA_EXPORT struct spa_log * pw_log_get(void)
Get the global log interface.
Definition: log.c:64
static uint32_t int int const char va_list args
Definition: core.h:327
SPA_EXPORT void pw_log_logv(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args)
Log a message with va_list.
Definition: log.c:120
SPA_EXPORT void pw_log_set(struct spa_log *log)
Set the global log interface.
Definition: log.c:48
enum spa_log_level pw_log_level
The global log level.
Definition: log.c:39