57 int line,
const char *func,
65 int line, const
char *func,
74 int line, const
char *func,
81 int line, const
char *func,
89#define PW_LOG_TOPIC_DEFINE_STATIC(var, topic) \
90 static struct spa_log_topic var = SPA_LOG_TOPIC(SPA_VERSION_LOG_TOPIC, topic); \
91 static void __attribute__((constructor)) var ## _register_construct(void) { pw_log_topic_register(&var); } \
92 static void __attribute__((destructor)) var ## _register_destroy(void) { pw_log_topic_unregister(&var); }
108#define PW_LOG_TOPIC_STATIC(var, topic) \
109 PW_LOG_TOPIC_DEFINE_STATIC(var ## _value, topic) \
110 static struct spa_log_topic * const var = &(var ## _value)
116#define PW_LOG_TOPIC_EXTERN(var) \
117 extern struct spa_log_topic * const var
123#define PW_LOG_TOPIC(var, topic) \
124 PW_LOG_TOPIC_DEFINE_STATIC(var ## _value, topic) \
125 struct spa_log_topic * const var = &(var ## _value)
132#define PW_LOG_TOPIC_INIT(var) \
133 spa_log_topic_init(pw_log_get(), var);
153#define pw_log_level_enabled(lev) (pw_log_level >= (lev))
154#define pw_log_topic_enabled(lev,t) ((t) && (t)->has_custom_level ? (t)->level >= (lev) : pw_log_level_enabled((lev)))
157#define pw_log_topic_custom_enabled(lev,t) ((t) && (t)->has_custom_level && (t)->level >= (lev))
159#define pw_logtv(lev,topic,fmt,ap) \
161 if (SPA_UNLIKELY(pw_log_topic_enabled(lev,topic))) \
162 pw_log_logtv(lev,topic,__FILE__,__LINE__,__func__,fmt,ap); \
165#define pw_logt(lev,topic,...) \
167 if (SPA_UNLIKELY(pw_log_topic_enabled(lev,topic))) \
168 pw_log_logt(lev,topic,__FILE__,__LINE__,__func__,__VA_ARGS__); \
171#define pw_log(lev,...) pw_logt(lev,PW_LOG_TOPIC_DEFAULT,__VA_ARGS__)
173#define pw_log_error(...) pw_log(SPA_LOG_LEVEL_ERROR,__VA_ARGS__)
174#define pw_log_warn(...) pw_log(SPA_LOG_LEVEL_WARN,__VA_ARGS__)
175#define pw_log_info(...) pw_log(SPA_LOG_LEVEL_INFO,__VA_ARGS__)
176#define pw_log_debug(...) pw_log(SPA_LOG_LEVEL_DEBUG,__VA_ARGS__)
177#define pw_log_trace(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
179#define pw_logt_error(t,...) pw_logt(SPA_LOG_LEVEL_ERROR,t,__VA_ARGS__)
180#define pw_logt_warn(t,...) pw_logt(SPA_LOG_LEVEL_WARN,t,__VA_ARGS__)
181#define pw_logt_info(t,...) pw_logt(SPA_LOG_LEVEL_INFO,t,__VA_ARGS__)
182#define pw_logt_debug(t,...) pw_logt(SPA_LOG_LEVEL_DEBUG,t,__VA_ARGS__)
183#define pw_logt_trace(t,...) pw_logt(SPA_LOG_LEVEL_TRACE,t,__VA_ARGS__)
186#define pw_log_trace_fp(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
188#define pw_log_trace_fp(...)
struct spa_log * pw_log_get(void)
Get the log interface.
Definition log.c:216
void pw_log_logtv(enum spa_log_level level, const struct spa_log_topic *topic, const char *file, int line, const char *func, const char *fmt, va_list args)
Log a message for a topic.
Definition log.c:382
struct spa_log_topic *const PW_LOG_TOPIC_DEFAULT
Definition log.c:30
void pw_log_topic_unregister(struct spa_log_topic *t)
Unregister log topic.
Definition log.c:156
void pw_log_logt(enum spa_log_level level, const struct spa_log_topic *topic, const char *file, int line, const char *func, const char *fmt,...)
Log a message for a topic.
Definition log.c:355
void pw_log_set(struct spa_log *log)
Configure a logging module.
Definition log.c:201
void pw_log_topic_register(struct spa_log_topic *t)
Register log topic with the logger, to enable dynamic log levels.
Definition log.c:135
int pw_log_set_level_string(const char *str)
Configure the logging level using a string in PIPEWIRE_DEBUG format.
Definition log.c:318
void pw_log_log(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...)
Log a message for the default topic.
Definition log.c:426
void pw_log_set_level(enum spa_log_level level)
Configure the logging level.
Definition log.c:225
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 for the default topic.
Definition log.c:405
enum spa_log_level pw_log_level
The global log level.
Definition log.c:25
spa_log_level
Definition log.h:45
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition defs.h:295
Identifier for a topic.
Definition log.h:83
enum spa_log_level level
Logging level, everything above this level is not logged.
Definition log.h:70