daemon: only call pw_log_set_level() if -v is actually given

Previous commit 69e935e unconditionally called pw_log_set_level() after
the option parsing. If pw_init() changed the logging level based on
PIPEWIRE_DEBUG, we'd now overwrite that change.

Call pw_log_set_level() only if -v is actually given on the commandline.
This means a commandline option will override PIPEWIRE_DEBUG if set but
that is intended.

Fixes 69e935e8a4
This commit is contained in:
Peter Hutterer 2021-09-25 07:21:01 +10:00
parent 69e935e8a4
commit 40487e485d
2 changed files with 2 additions and 4 deletions

View file

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
switch (c) {
case 'v':
if (level < SPA_LOG_LEVEL_TRACE)
level++;
pw_log_set_level(++level);
break;
case 'h':
show_help(argv[0], config_name);
@ -101,7 +101,6 @@ int main(int argc, char *argv[])
goto done;
}
}
pw_log_set_level(level);
properties = pw_properties_new(
PW_KEY_CONFIG_NAME, config_name,

View file

@ -2455,7 +2455,7 @@ int main(int argc, char *argv[])
switch (c) {
case 'v':
if (level < SPA_LOG_LEVEL_TRACE)
level++;
pw_log_set_level(++level);
break;
case 'h':
do_show_help = true;
@ -2475,7 +2475,6 @@ int main(int argc, char *argv[])
return -1;
}
}
pw_log_set_level(level);
impl.this.props = pw_properties_new(
PW_KEY_CONFIG_PREFIX, SESSION_PREFIX,