Go to the documentation of this file.
25 #ifndef PIPEWIRE_LOG_H
26 #define PIPEWIRE_LOG_H
78 #define pw_log_level_enabled(lev) (pw_log_level >= (lev))
80 #define pw_log(lev,...) \
82 if (SPA_UNLIKELY(pw_log_level_enabled (lev))) \
83 pw_log_log(lev,__FILE__,__LINE__,__func__,__VA_ARGS__); \
86 #define pw_log_error(...) pw_log(SPA_LOG_LEVEL_ERROR,__VA_ARGS__)
87 #define pw_log_warn(...) pw_log(SPA_LOG_LEVEL_WARN,__VA_ARGS__)
88 #define pw_log_info(...) pw_log(SPA_LOG_LEVEL_INFO,__VA_ARGS__)
89 #define pw_log_debug(...) pw_log(SPA_LOG_LEVEL_DEBUG,__VA_ARGS__)
90 #define pw_log_trace(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
93 #define pw_log_trace_fp(...) pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
95 #define pw_log_trace_fp(...)
@ SPA_TYPE_Pointer
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:61
static uint32_t int int const char int r
Definition: core.h:341
#define SPA_POD_CHOICE_BODY_FOREACH(body, _size, iter)
Definition: iter.h:102
enum spa_log_level level const char int const char * func
Definition: log-impl.h:46
SPA_EXPORT void pw_log_set_level(enum spa_log_level level)
Set the global log level.
Definition: log.c:71
uint32_t type
one of enum spa_type
Definition: pod/pod.h:170
const struct spa_type_info spa_type_control[]
Definition: control/type-info.h:45
@ SPA_TYPE_Sequence
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:60
const struct spa_type_info spa_type_choice[]
Definition: utils/type-info.h:69
spa_log_level
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:46
uint32_t type
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:137
uint32_t unit
Definition: pod/pod.h:226
Definition: pod/pod.h:180
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:136
@ SPA_TYPE_Long
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:49
Definition: pod/pod.h:169
Definition: pod/pod.h:199
uint32_t id
id of the object, depends on the object type
Definition: pod/pod.h:171
@ SPA_TYPE_Bool
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:46
@ SPA_TYPE_None
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:45
#define SPA_EXPORT
Definition: defs.h:207
Definition: pod/pod.h:218
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
struct spa_pod child
Definition: pod/pod.h:151
SPA_EXPORT struct spa_log * pw_log_get(void)
Get the global log interface.
Definition: log.c:62
@ SPA_TYPE_Object
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:59
#define SPA_POD_OBJECT_BODY_FOREACH(body, size, iter)
Definition: iter.h:118
@ SPA_TYPE_Id
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:47
#define SPA_POD_TYPE(pod)
Definition: pod/pod.h:41
const void * value
Definition: pod/pod.h:183
Definition: pod/pod.h:148
struct spa_interface iface
the version of this log.
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:65
SPA_LOG_IMPL(default_log)
#define DEFAULT_LOG_LEVEL
Definition: log.c:36
enum spa_log_level level
Definition: log.c:157
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:204
#define SPA_POD_ARRAY_BODY_FOREACH(body, _size, iter)
Definition: iter.h:94
@ SPA_TYPE_Fraction
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:55
#define _log(_c, fmt,...)
Definition: log.c:163
Definition: pod/pod.h:225
const char * name
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:139
void pw_log_log_object(enum spa_log_level level, const char *file, int line, const char *func, uint32_t flags, const void *object)
Definition: log.c:321
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:88
const char * func
Definition: log.c:160
@ SPA_TYPE_String
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:52
@ SPA_TYPE_Struct
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:58
uint32_t type
type of control, enum spa_control_type
Definition: pod/pod.h:220
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:62
@ SPA_TYPE_Bitmap
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:56
void void pw_log_logv(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args) SPA_PRINTF_FUNC(5
Log a message.
enum spa_log_level level const char int const char const char * fmt
Definition: log-impl.h:47
Definition: pod/pod.h:122
uint32_t type
pointer id, one of enum spa_type
Definition: pod/pod.h:181
#define SPA_POD_SEQUENCE_BODY_FOREACH(body, size, iter)
Definition: iter.h:126
enum spa_log_level level
Logging level, everything above this level is not logged.
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:69
#define SPA_POD_BODY(pod)
Definition: pod/pod.h:47
uint32_t key
key of property, list of valid keys depends on the object type
Definition: pod/pod.h:200
@ SPA_TYPE_Bytes
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:53
@ SPA_TYPE_Rectangle
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:54
uint32_t size
Definition: pod/pod.h:51
enum spa_log_level level const char int line
Definition: log-impl.h:45
#define SPA_TYPE_ROOT
Definition: utils/type-info.h:40
@ SPA_TYPE_Choice
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:63
#define SPA_POD_BODY_SIZE(pod)
Definition: pod/pod.h:40
@ SPA_TYPE_Fd
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:62
const struct spa_type_info * values
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:140
struct spa_pod value
control value, depends on type
Definition: pod/pod.h:221
uint32_t denom
Definition: defs.h:106
uint32_t type
type of choice, one of enum spa_choice_type
Definition: pod/pod.h:149
const char * file
Definition: log.c:158
enum spa_log_level level const char * file
Definition: log-impl.h:43
#define spa_interface_call(iface, type, method, vers,...)
Definition: hook.h:167
uint32_t type
Definition: pod/pod.h:52
bool pw_log_is_default(void)
Definition: log.c:53
SPA_EXPORT void pw_log_set(struct spa_log *log)
Set the global log interface.
Definition: log.c:47
@ SPA_TYPE_Int
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:48
const struct spa_type_info * spa_debug_type_find(const struct spa_type_info *info, uint32_t type)
Definition: types.h:41
uint32_t flags
flags for property
Definition: pod/pod.h:210
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:72
#define SPA_POD_CONTENTS(type, pod)
Definition: pod/pod.h:45
struct spa_pod value
Definition: pod/pod.h:211
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:115
uint32_t num
Definition: defs.h:105
uint32_t flags
extra flags
Definition: pod/pod.h:150
void pw_log_log(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...) SPA_PRINTF_FUNC(5
Log a message.
#define SPA_POD_FOREACH(pod, size, iter)
Definition: iter.h:110
#define SPA_UNLIKELY(x)
Definition: defs.h:233
uint32_t offset
media offset
Definition: pod/pod.h:219
SPA_EXPORT enum spa_log_level pw_log_level
The global log level.
Definition: log.c:39
static uint32_t int int const char va_list args
Definition: core.h:330
int line
Definition: log.c:159
@ SPA_TYPE_Array
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:57
struct spa_pod child
Definition: pod/pod.h:123
@ SPA_TYPE_Float
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:50
@ SPA_TYPE_Double
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:51
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68