mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
pipewire: fix pw_debug_is_category_enabled()
The function was broken since the log topics were added. Use the logger to init a topic with the given name and check if there was a custom level for the topic.
This commit is contained in:
parent
e5ac60b2b2
commit
34973eac89
1 changed files with 3 additions and 12 deletions
|
|
@ -81,7 +81,6 @@ struct registry {
|
|||
};
|
||||
|
||||
struct support {
|
||||
char **categories;
|
||||
const char *plugin_dir;
|
||||
const char *support_lib;
|
||||
struct registry registry;
|
||||
|
|
@ -701,7 +700,6 @@ void pw_deinit(void)
|
|||
spa_list_consume(h, ®istry->handles, link)
|
||||
unref_handle(h);
|
||||
|
||||
pw_free_strv(support->categories);
|
||||
free(support->i18n_domain);
|
||||
spa_zero(global_support);
|
||||
pthread_mutex_unlock(&support_lock);
|
||||
|
|
@ -721,16 +719,9 @@ done:
|
|||
SPA_EXPORT
|
||||
bool pw_debug_is_category_enabled(const char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (global_support.categories == NULL)
|
||||
return false;
|
||||
|
||||
for (i = 0; global_support.categories[i]; i++) {
|
||||
if (spa_streq(global_support.categories[i], name))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
struct spa_log_topic t = SPA_LOG_TOPIC(0, name);
|
||||
PW_LOG_TOPIC_INIT(&t);
|
||||
return t.has_custom_level;
|
||||
}
|
||||
|
||||
/** Get the application name */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue