PipeWire 1.2.5
|
Files | |
file | log.h |
pipewire/log.h | |
Macros | |
#define | PW_LOG_TOPIC_DEFINE_STATIC(var, topic) |
Define a static spa_log_topic and its constructor/destructor functions. | |
#define | PW_LOG_TOPIC_STATIC(var, topic) |
Declare a static log topic named var. | |
#define | PW_LOG_TOPIC_EXTERN(var) extern struct spa_log_topic * const var |
Declare a static log topic named var. | |
#define | PW_LOG_TOPIC(var, topic) |
Declare a static log topic named var. | |
#define | PW_LOG_TOPIC_INIT(var) spa_log_topic_init(pw_log_get(), var); |
#define | pw_log_level_enabled(lev) (pw_log_level >= (lev)) |
Check if a loglevel is enabled. | |
#define | pw_log_topic_enabled(lev, t) ((t) && (t)->has_custom_level ? (t)->level >= (lev) : pw_log_level_enabled((lev))) |
#define | pw_log_topic_custom_enabled(lev, t) ((t) && (t)->has_custom_level && (t)->level >= (lev)) |
#define | pw_logtv(lev, topic, fmt, ap) |
#define | pw_logt(lev, topic, ...) |
#define | pw_log(lev, ...) pw_logt(lev,PW_LOG_TOPIC_DEFAULT,__VA_ARGS__) |
#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_logt_error(t, ...) pw_logt(SPA_LOG_LEVEL_ERROR,t,__VA_ARGS__) |
#define | pw_logt_warn(t, ...) pw_logt(SPA_LOG_LEVEL_WARN,t,__VA_ARGS__) |
#define | pw_logt_info(t, ...) pw_logt(SPA_LOG_LEVEL_INFO,t,__VA_ARGS__) |
#define | pw_logt_debug(t, ...) pw_logt(SPA_LOG_LEVEL_DEBUG,t,__VA_ARGS__) |
#define | pw_logt_trace(t, ...) pw_logt(SPA_LOG_LEVEL_TRACE,t,__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. | |
struct spa_log * | pw_log_get (void) |
Get the log interface. | |
void | pw_log_set_level (enum spa_log_level level) |
Configure the logging level. | |
int | pw_log_set_level_string (const char *str) |
Configure the logging level using a string in PIPEWIRE_DEBUG format. | |
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. | |
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. | |
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. | |
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. | |
void | pw_log_topic_register (struct spa_log_topic *t) |
Register log topic with the logger, to enable dynamic log levels. | |
void | pw_log_topic_unregister (struct spa_log_topic *t) |
Unregister log topic. | |
Variables | |
enum spa_log_level | pw_log_level |
The global log level. | |
struct spa_log_topic *const | PW_LOG_TOPIC_DEFAULT |
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.
#define PW_LOG_TOPIC_DEFINE_STATIC | ( | var, | |
topic ) |
Define a static spa_log_topic and its constructor/destructor functions.
#define PW_LOG_TOPIC_STATIC | ( | var, | |
topic ) |
Declare a static log topic named var.
The usual usage is:
This macro also emits GCC attribute constructor/destructor functions that automatically call pw_log_topic_register/unregister.
#define PW_LOG_TOPIC_EXTERN | ( | var | ) | extern struct spa_log_topic * const var |
Declare a static log topic named var.
See PW_LOG_TOPIC_STATIC for an example usage.
#define PW_LOG_TOPIC | ( | var, | |
topic ) |
Declare a static log topic named var.
See PW_LOG_TOPIC_STATIC for an example usage.
#define PW_LOG_TOPIC_INIT | ( | var | ) | spa_log_topic_init(pw_log_get(), var); |
#define pw_log_level_enabled | ( | lev | ) | (pw_log_level >= (lev)) |
Check if a loglevel is enabled.
#define pw_log_topic_enabled | ( | lev, | |
t ) ((t) && (t)->has_custom_level ? (t)->level >= (lev) : pw_log_level_enabled((lev))) |
#define pw_log_topic_custom_enabled | ( | lev, | |
t ) ((t) && (t)->has_custom_level && (t)->level >= (lev)) |
#define pw_logtv | ( | lev, | |
topic, | |||
fmt, | |||
ap ) |
#define pw_logt | ( | lev, | |
topic, | |||
... ) |
#define pw_log | ( | lev, | |
... ) pw_logt(lev,PW_LOG_TOPIC_DEFAULT,__VA_ARGS__) |
#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_logt_error | ( | t, | |
... ) pw_logt(SPA_LOG_LEVEL_ERROR,t,__VA_ARGS__) |
#define pw_logt_warn | ( | t, | |
... ) pw_logt(SPA_LOG_LEVEL_WARN,t,__VA_ARGS__) |
#define pw_logt_info | ( | t, | |
... ) pw_logt(SPA_LOG_LEVEL_INFO,t,__VA_ARGS__) |
#define pw_logt_debug | ( | t, | |
... ) pw_logt(SPA_LOG_LEVEL_DEBUG,t,__VA_ARGS__) |
#define pw_logt_trace | ( | t, | |
... ) pw_logt(SPA_LOG_LEVEL_TRACE,t,__VA_ARGS__) |
#define pw_log_trace_fp | ( | ... | ) | pw_log(SPA_LOG_LEVEL_TRACE,__VA_ARGS__) |
void pw_log_set | ( | struct spa_log * | log | ) |
struct spa_log * pw_log_get | ( | void | ) |
Get the log interface.
Get the log interface.
void pw_log_set_level | ( | enum spa_log_level | level | ) |
Configure the logging level.
Configure the logging level.
level | the new log level |
int pw_log_set_level_string | ( | const char * | str | ) |
Configure the logging level using a string in PIPEWIRE_DEBUG format.
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.
Log a message for a topic.
level | the log level |
topic | the topic |
file | the file this message originated from |
line | the line number |
func | the function |
fmt | the printf style format |
... | printf style arguments to log |
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.
Log a message for a topic.
level | the log level |
topic | the topic |
file | the file this message originated from |
line | the line number |
func | the function |
fmt | the printf style format |
args | a va_list of arguments |
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.
level | the log level |
file | the file this message originated from |
line | the line number |
func | the function |
fmt | the printf style format |
... | printf style arguments to log |
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.
Log a message for the default topic.
level | the log level |
file | the file this message originated from |
line | the line number |
func | the function |
fmt | the printf style format |
args | a va_list of arguments |
void pw_log_topic_register | ( | struct spa_log_topic * | t | ) |
Register log topic with the logger, to enable dynamic log levels.
Topic must be unregistered before freeing it or plugin unload. May be used instead of PW_LOG_TOPIC_INIT This function is threadsafe.
void pw_log_topic_unregister | ( | struct spa_log_topic * | t | ) |
Unregister log topic.
This function is threadsafe.
|
extern |
The global log level.
|
extern |