log: add pw_log_topic_custom_enabled()

Add a function to check if a specfic custom log level has been defined
for a topic.

We can use this to dynamically check if we need to do the connection debug
messages.

We can also get rid of the conn.* pattern hack to disable connection
messages by default.
This commit is contained in:
Wim Taymans 2024-01-04 17:40:57 +01:00
parent 5152c98789
commit a3c6b3acae
8 changed files with 14 additions and 22 deletions

View file

@ -718,7 +718,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
else
buf->n_fds = buf->msg.n_fds;
if (mod_topic_connection->level >= SPA_LOG_LEVEL_DEBUG) {
if (pw_log_topic_custom_enabled(SPA_LOG_LEVEL_DEBUG, mod_topic_connection)) {
pw_logt_debug(mod_topic_connection,
">>>>>>>>> out: id:%d op:%d size:%d seq:%d fds:%d",
buf->msg.id, buf->msg.opcode, size, buf->msg.seq,