fix(install): configure logging earlier

There are log_error() and log_debug() calls in parse_argv().
master
Marcos Mello 2021-05-24 16:16:03 -03:00 committed by Harald Hoyer
parent 7d205598c6
commit 5eb24aa21d
1 changed files with 8 additions and 8 deletions

View File

@ -1166,6 +1166,10 @@ static int parse_argv(int argc, char *argv[])
}
}

if (arg_loglevel >= 0) {
log_set_max_level(arg_loglevel);
}

if (!kerneldir) {
struct utsname buf;
uname(&buf);
@ -2002,18 +2006,14 @@ int main(int argc, char **argv)
char *path = NULL;
char *env_no_xattr = NULL;

log_set_target(LOG_TARGET_CONSOLE);
log_parse_environment();
log_open();

r = parse_argv(argc, argv);
if (r <= 0)
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;

log_set_target(LOG_TARGET_CONSOLE);
log_parse_environment();

if (arg_loglevel >= 0)
log_set_max_level(arg_loglevel);

log_open();

modules_loaded = hashmap_new(string_hash_func, string_compare_func);
if (arg_modalias) {
Iterator i;