14 Commits

Author SHA1 Message Date
George Kiagiadakis
4736d56557 log: implement a log topics system, like pipewire
The intention is to make checks for enabled log topics faster.

Every topic has its own structure that is statically defined in the file
where the logs are printed from. The structure is initialized transparently
when it is first used and it contains all the log level flags for the levels
that this topic should print messages. It is then checked on the wp_log()
macro before printing the message.

Topics from SPA/PipeWire are also handled natively, so messages are printed
directly without checking if the topic is enabled, since the PipeWire and SPA
macros do the checking themselves.

Messages coming from GLib are checked inside the handler.

An internal WpLogFields object is used to manage the state of each log
message, populating all the fields appropriately from the place they
are coming from (wp_log, spa_log, glib log), formatting the message and
then printing it. For printing to the journald, we still use the glib
message handler, converting all the needed fields to GLogField on demand.
That message handler does not do any checks for the topic or the level, so
we can just call it to send the message.
2023-05-16 20:42:28 +03:00
Julian Bouzas
c86410e708 iterator: skip NULL pointers when iterating pointer arrays 2022-06-27 08:52:36 +00:00
George Kiagiadakis
e04acbd2a0 docs: remove protected annotations from functions to show them in the docs 2021-12-22 17:09:20 +02:00
Peter Hutterer
21266a5bec lib: correct documentation for wp_iterator_fold/foreach 2021-11-18 12:09:57 +00:00
Jason Francis
ed8346e77d docs: Add brief descriptions to all functions
This ensures all of these functions are picked up by g-ir-scanner.
2021-06-02 17:38:34 +00:00
George Kiagiadakis
b812e912d2 docs: fix C API documentation to work nicely with doxygen & sphinx 2021-05-25 14:19:53 +03:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
George Kiagiadakis
7eed2acd76 lib: documentation fixes 2021-03-04 19:10:10 +02:00
George Kiagiadakis
7f40a8152d iterator: add version field in the methods struct
Similar to how pipewire interfaces are versioned.
Keeps the struct extensible without breaking ABI.
2020-11-16 11:16:35 +02:00
George Kiagiadakis
37134df7c8 iterator: make private stuff public, cleanup private.h further
There is no good reason to keep them private
2020-11-15 20:26:15 +02:00
George Kiagiadakis
b8d1f40111 iterator: add a generic GPtrArray iterator implementation 2020-05-25 18:54:41 +03:00
George Kiagiadakis
1dccdcf415 object-manager: replace GPtrArray API with WpIterator
+ add the useful _find_proxy() method
2020-04-21 13:21:03 +03:00
George Kiagiadakis
9ca342f89f debug: update all library code to use the new debug system
+ enable the new log writer on the executables
+ enable structured logging in the tests
2020-04-14 18:31:17 +03:00
Julian Bouzas
5846fb919f lib: add iterator base class API 2020-04-07 14:18:11 -04:00