pipewire/test
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
..
meson.build spa: add topic-based logging 2021-09-28 09:35:38 +02:00
pwtest-compat.c test: add sigabbrev_np() for systems where it's not available 2021-06-10 15:13:57 +10:00
pwtest-implementation.h test: add errno check macros 2021-06-09 18:00:06 +10:00
pwtest.c test: fix the environment variable name to disable systemd logging 2021-09-24 12:33:15 +10:00
pwtest.h meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-array.c meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-client.c test: move the client and utils tests over here 2021-08-04 07:45:06 +00:00
test-config.c test: fix a memleak in the config tests 2021-07-07 11:03:23 +00:00
test-context.c test: remove duplicate test invocation 2021-07-06 07:14:21 +00:00
test-example.c meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-lib.c meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-logger.c test: simplify the logger test a bit 2021-09-24 12:33:02 +10:00
test-properties.c test: move some of the property tests to pwtest 2021-06-17 07:08:53 +00:00
test-pwtest.c test: add sigabbrev_np() for systems where it's not available 2021-06-10 15:13:57 +10:00
test-spa-buffer.c test: convert two spa tests to pwtest 2021-06-09 18:00:39 +10:00
test-spa-json.c test: convert two spa tests to pwtest 2021-06-09 18:00:39 +10:00
test-spa-log.c spa: add topic-based logging 2021-09-28 09:35:38 +02:00
test-spa-node.c test: replace all spa_assert() macros with spa_assert_se() 2021-07-27 10:24:44 +10:00
test-spa-pod.c test: replace all spa_assert() macros with spa_assert_se() 2021-07-27 10:24:44 +10:00
test-spa-utils.c spa: add a macro to check for a callback version 2021-09-28 09:35:38 +02:00
test-support.c test: add a test for the logger truncation 2021-06-09 18:00:39 +10:00
test-utils.c test: move the client and utils tests over here 2021-08-04 07:45:06 +00:00