log: store log level in topics
When there is no specific level for a topic we store the global log level in the topic level. Make sure this invariant is preserved when the the global log level is updated. We can then simply update the log level after we processed the log level string to update all topics. This should also make it possible to just use the level from the topic in all cases and remove a check.
This commit is contained in:
parent
e088dd2d2f
commit
5152c98789
|
@ -226,6 +226,8 @@ void pw_log_set_level(enum spa_log_level level)
|
|||
{
|
||||
pw_log_level = level;
|
||||
global_log->level = level;
|
||||
|
||||
update_all_topic_levels();
|
||||
}
|
||||
|
||||
static int add_pattern(struct spa_list *list, const char *str, enum spa_log_level level)
|
||||
|
@ -327,9 +329,6 @@ int pw_log_set_level_string(const char *str)
|
|||
if ((res = parse_log_string(str, &new_patterns, &level)) < 0)
|
||||
return res;
|
||||
|
||||
pw_log_level = level;
|
||||
global_log->level = level;
|
||||
|
||||
pthread_mutex_lock(&topics_lock);
|
||||
|
||||
spa_list_consume(pattern, &patterns, link) {
|
||||
|
@ -341,7 +340,7 @@ int pw_log_set_level_string(const char *str)
|
|||
|
||||
pthread_mutex_unlock(&topics_lock);
|
||||
|
||||
update_all_topic_levels();
|
||||
pw_log_set_level(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue