PipeWire  0.3.38
log.c File Reference
Include dependency graph for log.c:

Data Structures

struct  log_ctx
 

Macros

#define DEFAULT_LOG_LEVEL   SPA_LOG_LEVEL_WARN
 
#define _log(_c, fmt, ...)
 

Functions

 SPA_LOG_IMPL (default_log)
 
 PW_LOG_TOPIC_STATIC (log_topic, "pw.log")
 
 PW_LOG_TOPIC (log_conf, "pw.conf")
 
 PW_LOG_TOPIC (log_context, "pw.context")
 
 PW_LOG_TOPIC (log_metadata, "pw.metadata")
 
 PW_LOG_TOPIC (log_node, "pw.node")
 
 PW_LOG_TOPIC (log_port, "pw.port")
 
 PW_LOG_TOPIC (log_core, "pw.core")
 
 PW_LOG_TOPIC (log_proxy, "pw.proxy")
 
 PW_LOG_TOPIC (log_global, "pw.global")
 
 PW_LOG_TOPIC (log_protocol, "pw.protocol")
 
 PW_LOG_TOPIC (log_client, "pw.client")
 
 PW_LOG_TOPIC (log_factory, "pw.factory")
 
 PW_LOG_TOPIC (log_module, "pw.module")
 
 PW_LOG_TOPIC (log_device, "pw.device")
 
 PW_LOG_TOPIC (log_resource, "pw.resource")
 
 PW_LOG_TOPIC (PW_LOG_TOPIC_DEFAULT, "default")
 
void pw_log_set (struct spa_log *log)
 Set the global log interface. More...
 
bool pw_log_is_default (void)
 
struct spa_logpw_log_get (void)
 Get the global log interface. More...
 
void pw_log_set_level (enum spa_log_level level)
 Set the global log level. More...
 
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 the given topic. More...
 
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 the given topic with va_list. More...
 
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 with va_list. More...
 
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. More...
 
void pw_log_log_object (enum spa_log_level level, const char *file, int line, const char *func, uint32_t flags, const void *object)
 
void _pw_log_topic_new (struct spa_log_topic *topic)
 Initialize the log topic. More...
 
void pw_log_init (void)
 

Variables

enum spa_log_level pw_log_level = DEFAULT_LOG_LEVEL
 The global log level. More...
 
struct spa_log_topicPW_LOG_TOPIC_DEFAULT
 

Macro Definition Documentation

◆ _log

#define _log (   _c,
  fmt,
  ... 
)
Value:
pw_log_log(_c->level, _c->file, _c->line, _c->func, \
"%*s" fmt, indent, "", ## __VA_ARGS__)
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:185

◆ DEFAULT_LOG_LEVEL

#define DEFAULT_LOG_LEVEL   SPA_LOG_LEVEL_WARN

Function Documentation

◆ pw_log_init()

void pw_log_init ( void  )

◆ pw_log_is_default()

bool pw_log_is_default ( void  )

◆ 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 for the default topic.

Parameters
levelthe log level
filethe file this message originated from
linethe line number
functhe function
fmtthe printf style format
...printf style arguments to log

References spa_log::level, pw_log_logtv(), and PW_LOG_TOPIC_DEFAULT.

Referenced by pw_log_log_object().

◆ pw_log_log_object()

void pw_log_log_object ( enum spa_log_level  level,
const char *  file,
int  line,
const char *  func,
uint32_t  flags,
const void *  object 
)

◆ pw_log_logt()

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 the given topic.

Parameters
levelthe log level
topicthe topic
filethe file this message originated from
linethe line number
functhe function
fmtthe printf style format
...printf style arguments to log

References spa_log::level, pw_log_topic_enabled, spa_log_logtv, and SPA_UNLIKELY.

◆ pw_log_logtv()

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 the given topic with va_list.

Parameters
levelthe log level
topicthe topic
filethe file this message originated from
linethe line number
functhe function
fmtthe printf style format
argsa va_list of arguments

References spa_log_logtv.

Referenced by pw_log_log(), and pw_log_logv().

◆ pw_log_logv()

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 with va_list.

Parameters
levelthe log level
filethe file this message originated from
linethe line number
functhe function
fmtthe printf style format
argsa va_list of arguments

References spa_log::level, pw_log_logtv(), and PW_LOG_TOPIC_DEFAULT.

◆ PW_LOG_TOPIC() [1/15]

PW_LOG_TOPIC ( log_conf  ,
"pw.conf"   
)

◆ PW_LOG_TOPIC() [2/15]

PW_LOG_TOPIC ( log_context  ,
"pw.context"   
)

◆ PW_LOG_TOPIC() [3/15]

PW_LOG_TOPIC ( log_metadata  ,
"pw.metadata"   
)

◆ PW_LOG_TOPIC() [4/15]

PW_LOG_TOPIC ( log_node  ,
"pw.node"   
)

◆ PW_LOG_TOPIC() [5/15]

PW_LOG_TOPIC ( log_port  ,
"pw.port"   
)

◆ PW_LOG_TOPIC() [6/15]

PW_LOG_TOPIC ( log_core  ,
"pw.core"   
)

◆ PW_LOG_TOPIC() [7/15]

PW_LOG_TOPIC ( log_proxy  ,
"pw.proxy"   
)

◆ PW_LOG_TOPIC() [8/15]

PW_LOG_TOPIC ( log_global  ,
"pw.global"   
)

◆ PW_LOG_TOPIC() [9/15]

PW_LOG_TOPIC ( log_protocol  ,
"pw.protocol"   
)

◆ PW_LOG_TOPIC() [10/15]

PW_LOG_TOPIC ( log_client  ,
"pw.client"   
)

◆ PW_LOG_TOPIC() [11/15]

PW_LOG_TOPIC ( log_factory  ,
"pw.factory"   
)

◆ PW_LOG_TOPIC() [12/15]

PW_LOG_TOPIC ( log_module  ,
"pw.module"   
)

◆ PW_LOG_TOPIC() [13/15]

PW_LOG_TOPIC ( log_device  ,
"pw.device"   
)

◆ PW_LOG_TOPIC() [14/15]

PW_LOG_TOPIC ( log_resource  ,
"pw.resource"   
)

◆ PW_LOG_TOPIC() [15/15]

PW_LOG_TOPIC ( PW_LOG_TOPIC_DEFAULT  ,
"default"   
)

◆ PW_LOG_TOPIC_STATIC()

PW_LOG_TOPIC_STATIC ( log_topic  ,
"pw.log"   
)

◆ SPA_LOG_IMPL()

SPA_LOG_IMPL ( default_log  )