Go to the documentation of this file.
25 #ifndef PIPEWIRE_LOG_H
26 #define PIPEWIRE_LOG_H
66 int line,
const char *func,
73 int line, const
char *func,
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(...)
enum spa_log_level pw_log_level
The global log level.
Definition: log.c:39
@ SPA_TYPE_None
Definition: build-12683127/doc/spa/utils/type.h:45
uint32_t width
Definition: defs.h:87
@ SPA_TYPE_Float
Definition: build-12683127/doc/spa/utils/type.h:50
#define SPA_POD_CHOICE_BODY_FOREACH(body, _size, iter)
Definition: iter.h:102
@ SPA_TYPE_Long
Definition: build-12683127/doc/spa/utils/type.h:49
void pw_log_log(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...) 1(5
Log a message.
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
const struct spa_type_info spa_type_choice[]
Definition: utils/type-info.h:69
spa_log_level
Definition: build-12683127/doc/spa/support/log.h:46
@ SPA_TYPE_Id
Definition: build-12683127/doc/spa/utils/type.h:47
uint32_t type
Definition: build-12683127/doc/spa/utils/type.h:138
uint32_t unit
Definition: pod/pod.h:227
@ SPA_TYPE_Int
Definition: build-12683127/doc/spa/utils/type.h:48
Definition: pod/pod.h:180
Definition: build-12683127/doc/spa/utils/type.h:137
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
#define SPA_EXPORT
Definition: defs.h:208
Definition: pod/pod.h:219
uint32_t height
Definition: defs.h:88
struct spa_pod child
Definition: pod/pod.h:151
@ SPA_TYPE_Array
Definition: build-12683127/doc/spa/utils/type.h:57
#define SPA_POD_OBJECT_BODY_FOREACH(body, size, iter)
Definition: iter.h:118
#define SPA_POD_TYPE(pod)
Definition: pod/pod.h:41
@ SPA_TYPE_Rectangle
Definition: build-12683127/doc/spa/utils/type.h:54
const void * value
Definition: pod/pod.h:183
Definition: pod/pod.h:148
struct spa_interface iface
Definition: build-12683127/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:205
#define SPA_POD_ARRAY_BODY_FOREACH(body, _size, iter)
Definition: iter.h:94
#define _log(_c, fmt,...)
Definition: log.c:163
@ SPA_TYPE_Pointer
Definition: build-12683127/doc/spa/utils/type.h:61
Definition: pod/pod.h:226
const char * name
Definition: build-12683127/doc/spa/utils/type.h:140
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_TYPE_Fd
Definition: build-12683127/doc/spa/utils/type.h:62
const char * func
Definition: log.c:160
@ SPA_TYPE_String
Definition: build-12683127/doc/spa/utils/type.h:52
@ SPA_TYPE_Bitmap
Definition: build-12683127/doc/spa/utils/type.h:56
uint32_t type
type of control, enum spa_control_type
Definition: pod/pod.h:221
Definition: build-12683127/doc/spa/support/log.h:61
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
@ SPA_TYPE_Bool
Definition: build-12683127/doc/spa/utils/type.h:46
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: build-12683127/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
#define spa_interface_call(iface, method_type, method, vers,...)
Invoke method named method in the callbacks on the given interface object.
Definition: hook.h:198
uint32_t size
Definition: pod/pod.h:51
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
#define SPA_TYPE_ROOT
Definition: utils/type-info.h:40
@ SPA_TYPE_Bytes
Definition: build-12683127/doc/spa/utils/type.h:53
@ SPA_TYPE_Double
Definition: build-12683127/doc/spa/utils/type.h:51
#define SPA_POD_BODY_SIZE(pod)
Definition: pod/pod.h:40
@ SPA_TYPE_Object
Definition: build-12683127/doc/spa/utils/type.h:59
@ SPA_TYPE_Sequence
Definition: build-12683127/doc/spa/utils/type.h:60
const struct spa_type_info * values
Definition: build-12683127/doc/spa/utils/type.h:141
struct spa_pod value
control value, depends on type
Definition: pod/pod.h:222
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
@ SPA_TYPE_Fraction
Definition: build-12683127/doc/spa/utils/type.h:55
void pw_log_set_level(enum spa_log_level level)
Set the global log level.
Definition: log.c:71
uint32_t type
Definition: pod/pod.h:52
struct spa_log * pw_log_get(void)
Get the global log interface.
Definition: log.c:62
void void pw_log_logv(enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args) 1(5
Log a message.
bool pw_log_is_default(void)
Definition: log.c:53
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 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:211
@ SPA_TYPE_Choice
Definition: build-12683127/doc/spa/utils/type.h:63
Definition: build-12683127/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:212
uint32_t num
Definition: defs.h:105
uint32_t flags
extra flags
Definition: pod/pod.h:150
void pw_log_set(struct spa_log *log)
Set the global log interface.
Definition: log.c:47
#define SPA_POD_FOREACH(pod, size, iter)
Definition: iter.h:110
#define SPA_UNLIKELY(x)
Definition: defs.h:235
uint32_t offset
media offset
Definition: pod/pod.h:220
int line
Definition: log.c:159
struct spa_pod child
Definition: pod/pod.h:123
@ SPA_TYPE_Struct
Definition: build-12683127/doc/spa/utils/type.h:58
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68