mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-22 06:59:59 -05:00
spa: add debug log context
Make a real debug context with a log function and move it to a new file. This way we don't need to redefine a macro. Make a new context for debugging to a log file. Make new functions to debug to a log file. Move the stringbuffer to string utils. Integrate file/line/func and topics into the debug log. We can remove some more things from the pipewire log_object function and also add support for topics.
This commit is contained in:
parent
3c67821c4a
commit
6207d98ff1
21 changed files with 231 additions and 164 deletions
|
|
@ -299,21 +299,6 @@ do { \
|
|||
#define spa_log_trace_fp(l,...)
|
||||
#endif
|
||||
|
||||
#define spa_log_hexdump(l,lev,indent,data,len) \
|
||||
({ \
|
||||
char str[512]; \
|
||||
uint8_t *buf = (uint8_t *)(data); \
|
||||
size_t i, j = (len); \
|
||||
int pos = 0; \
|
||||
\
|
||||
for (i = 0; i < j; i++) { \
|
||||
if (i % 16 == 0) \
|
||||
pos = 0; \
|
||||
pos += sprintf(str + pos, "%02x ", buf[i]); \
|
||||
if (i % 16 == 15 || i == j - 1) \
|
||||
spa_log_lev(l,lev, "%*s" "%s",indent,"", str); \
|
||||
} \
|
||||
})
|
||||
|
||||
/** \fn spa_log_error */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue