journal: make it possible to set level from info

This commit is contained in:
Wim Taymans 2020-11-18 17:42:47 +01:00
parent cb203e38c3
commit 04aa5472d3

View file

@ -195,6 +195,7 @@ impl_init(const struct spa_handle_factory *factory,
uint32_t n_support)
{
struct impl *impl;
const char *str;
spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(handle != NULL, -EINVAL);
@ -210,6 +211,11 @@ impl_init(const struct spa_handle_factory *factory,
&impl_log, impl);
impl->log.level = DEFAULT_LOG_LEVEL;
if (info) {
if ((str = spa_dict_lookup(info, SPA_KEY_LOG_LEVEL)) != NULL)
impl->log.level = atoi(str);
}
/* if our stderr goes to the journal, there's no point in logging both
* via the native journal API and by printing to stderr, that would just
* result in message duplication */