pipewire/spa/include/spa/support
Peter Hutterer 0e60e9c063 spa: add topic-based logging
Add a struct spa_log_topic that allows for logical grouping of messages.
The new macros spa_log_logt() and spa_log_logtv() take a topic as
argument, the topic's level acts as filter.
A new macro spa_log_topic_init() initializes a topic. By default a topic
inherits its logger's debug level but a logger implementation may set
that topic to a specific fixed log level.

The various spa_log_*() macros transparently wrap new and old
implementations:
- if the implementation is version 0, the new logt() calls drop the
  topic and get routed into the old log() calls
- if the implementation is version 1, the old log() calls use a NULL
  topic and get routed into the new logt() calls

All spa_log_* macros use the SPA_LOG_DEFAULT_TOPIC topic (NULL), it is
up to the caller to redefine that. Alternatively, use spa_logt_* to pass
an explicit topic.

There is one crucial flaw in this implementation: log topics are
initialized to their target level by the current logger. Where a topic
is initialized but the logger is switched later, the topic is not
automatically re-initialized. Ultimately this shouldn't matter for
real-world use-cases.
2021-09-28 09:35:38 +02:00
..
cpu.h spa: group the spa headers into doxygen modules 2021-05-26 07:44:55 +00:00
dbus.h dbus: keep a ref to DBusConnection if reconnecting is not handled 2021-06-26 16:11:40 +03:00
i18n.h spa: mark the gettext wrappers with __attribute__((format_arg)) 2021-09-07 08:26:10 +10:00
log-impl.h spa: group the spa headers into doxygen modules 2021-05-26 07:44:55 +00:00
log.h spa: add topic-based logging 2021-09-28 09:35:38 +02:00
loop.h spa: group the spa headers into doxygen modules 2021-05-26 07:44:55 +00:00
plugin-loader.h spa/support: add plugin loader interface 2021-09-03 20:12:28 +03:00
plugin.h spa: group the spa headers into doxygen modules 2021-05-26 07:44:55 +00:00
system.h spa: group the spa headers into doxygen modules 2021-05-26 07:44:55 +00:00
thread.h thread: fix compilation 2021-07-06 16:20:05 +02:00