log: add topic loggers and a default topic
pw_log_log/logv now go through the topic-based logger using the "default" topic. Log topics themselves can be allocated by the call sites. The simplest way to use a topic from e.g. a module: PW_LOG_TOPIC_STATIC(mod_topic, "mod.foo"); #define PW_LOG_TOPIC_DEFAULT mod_topic ... void pipewire__module_init() { PW_LOG_TOPIC_INIT(mod_topic); ... } With the #define all pw_log_foo() are now routed through the custom topic. For the cases where the log topic must be specified, a pw_logt_foo() set of macros is available. Log topics are enabled through the PIPEWIRE_DEBUG environment variable which now supports globs, e.g. PIPEWIRE_DEBUG="*:I;mod.access:D" to enable global INFO but DEBUG for the access module. Namespaces documented are "pw", "mod" and "conn", for pipewire-internal stuff, modules and connection dumping. The latter is special-cased to avoid spamming the log files, it requires an expcit "conn.<glob>" pattern to enable. The "default" topic always exists and is the fallback for any pw_log_foo() invocation that does not use a topic.
Loading
Please register or sign in to comment