pw_log Class Reference

Logging functions of PipeWire. More...

## Public Member Functions

#define | pw_log_level_enabled(lev) (pw_log_level >= (lev))
| Check if a loglevel is enabled. More...
SPA_EXPORT void | pw_log_set (struct spa_log *log)
| Set the global log interface. More...
SPA_EXPORT struct spa_log * | pw_log_get (void)
| Get the global log interface. More...
SPA_EXPORT void | pw_log_set_level (enum spa_log_level level)
| Set the global log level. More...
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. More...
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. More...
void | pw_log_error (const char *format,...)
| Log an error message. More...
void | pw_log_warn (const char *format,...)
| Log a warning message. More...
void | pw_log_info (const char *format,...)
| Log an info message. More...
void | pw_log_debug (const char *format,...)
| Log a debug message. More...
void | pw_log_trace (const char *format,...)
| Log a trace message. 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.

## Member Function Documentation

## pw_log_debug()

void pw_log_debug | ( | const char * | format,
|  |  | ...
| ) |  |

Log a debug message.

Parameters

  format | a printf style format
  ... | printf style arguments

Referenced by pw_data_loop::pw_data_loop_destroy(), pw_data_loop::pw_data_loop_new(), pw_main_loop::pw_main_loop_destroy(), pw_main_loop::pw_main_loop_new(), pw_main_loop::pw_main_loop_quit(), and pw_main_loop::pw_main_loop_run().

## pw_log_error()

void pw_log_error | ( | const char * | format,
|  |  | ...
| ) |  |

Log an error message.

Parameters

  format | a printf style format
  ... | printf style arguments

## pw_log_get()

SPA_EXPORT struct spa_log * pw_log_get | ( | void |  | ) |

Get the global log interface.

Returns
  the global log

## pw_log_info()

void pw_log_info | ( | const char * | format,
|  |  | ...
| ) |  |

Log an info message.

Parameters

  format | a printf style format
  ... | printf style arguments

## pw_log_log()

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.

Parameters

  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

References pw_log_level_enabled.

## pw_log_logv()

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.

Parameters

  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

References pw_log_level_enabled.

## pw_log_set()

SPA_EXPORT void pw_log_set | ( | struct spa_log * | log | ) |

Set the global log interface.

Parameters

  log | the global log to set

## pw_log_set_level()

SPA_EXPORT void pw_log_set_level | ( | enum spa_log_level | level | ) |

Set the global log level.

Parameters

  level | the new log level

References pw_log_level.

## pw_log_trace()

void pw_log_trace | ( | const char * | format,
|  |  | ...
| ) |  |

Log a trace message.

Trace messages may be generated from

Parameters

  format | a printf style format
  ... | printf style arguments realtime threads

## pw_log_warn()

void pw_log_warn | ( | const char * | format,
|  |  | ...
| ) |  |

Log a warning message.

Parameters

  format | a printf style format
  ... | printf style arguments

The documentation for this class was generated from the following files:

- log.h
- log.c