PipeWire  0.3.32
Logging

Logging functions of PipeWire. More...

Macros

#define pw_log_level_enabled(lev)   (pw_log_level >= (lev))
 Check if a loglevel is enabled. More...
 
#define pw_log(lev, ...)
 
#define pw_log_error(...)   pw_log(SPA_LOG_LEVEL_ERROR,__VA_ARGS__)
 
#define pw_log_warn(...)   pw_log(SPA_LOG_LEVEL_WARN,__VA_ARGS__)
 
#define pw_log_info(...)   pw_log(SPA_LOG_LEVEL_INFO,__VA_ARGS__)
 
#define pw_log_debug(...)   pw_log(SPA_LOG_LEVEL_DEBUG,__VA_ARGS__)
 
#define pw_log_trace(...)   pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
 
#define pw_log_trace_fp(...)   pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)
 

Functions

void pw_log_set (struct spa_log *log)
 Configure a logging module. More...
 
struct spa_logpw_log_get (void)
 Get the log interface. More...
 
void pw_log_set_level (enum spa_log_level level)
 Configure the logging level. More...
 
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. More...
 
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. More...
 

Variables

enum spa_log_level pw_log_level
 The global log level. More...
 

Detailed Description

Logging functions of PipeWire.

Logging is performed to stdout and stderr. Trace logging is performed in a lockfree ringbuffer and written out from the main thread as to not block the realtime threads.

Macro Definition Documentation

◆ pw_log

#define pw_log (   lev,
  ... 
)
Value:
({ \
pw_log_log(lev,__FILE__,__LINE__,__func__,__VA_ARGS__); \
})

◆ pw_log_debug

#define pw_log_debug (   ...)    pw_log(SPA_LOG_LEVEL_DEBUG,__VA_ARGS__)

◆ pw_log_error

#define pw_log_error (   ...)    pw_log(SPA_LOG_LEVEL_ERROR,__VA_ARGS__)

◆ pw_log_info

#define pw_log_info (   ...)    pw_log(SPA_LOG_LEVEL_INFO,__VA_ARGS__)

◆ pw_log_level_enabled

#define pw_log_level_enabled (   lev)    (pw_log_level >= (lev))

Check if a loglevel is enabled.

◆ pw_log_trace

#define pw_log_trace (   ...)    pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)

◆ pw_log_trace_fp

#define pw_log_trace_fp (   ...)    pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__)

◆ pw_log_warn

#define pw_log_warn (   ...)    pw_log(SPA_LOG_LEVEL_WARN,__VA_ARGS__)

Function Documentation

◆ pw_log_get()

struct spa_log* pw_log_get ( void  )

Get the log interface.

Get the log interface.

Returns
the global log

◆ pw_log_log()

void pw_log_log ( enum spa_log_level  level,
const char *  file,
int  line,
const char *  func,
const char *  fmt,
  ... 
)

Log a message.

◆ pw_log_logv()

void 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.

◆ pw_log_set()

void pw_log_set ( struct spa_log log)

Configure a logging module.

This is usually done automatically in pw_init() but you can install a custom logger before calling pw_init().

Configure a logging module.

Parameters
logthe global log to set

◆ pw_log_set_level()

void pw_log_set_level ( enum spa_log_level  level)

Configure the logging level.

Configure the logging level.

Parameters
levelthe new log level

References spa_log::level, and pw_log_level.

Variable Documentation

◆ pw_log_level

enum spa_log_level pw_log_level
extern

The global log level.

Referenced by pw_log_set_level().

pw_log_level_enabled
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
SPA_UNLIKELY
#define SPA_UNLIKELY(x)
Definition: defs.h:235