mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-05 11:20:36 +02:00
main: (order) move run_from_build_dir check before setting up logging
Or: move setup of nm-logging immediately after it is really needed: before setup of config.
This commit is contained in:
parent
49cfe64874
commit
7fe0f349ce
1 changed files with 15 additions and 15 deletions
30
src/main.c
30
src/main.c
|
|
@ -295,21 +295,6 @@ main (int argc, char *argv[])
|
|||
|
||||
nm_main_utils_ensure_rundir ();
|
||||
|
||||
if (!nm_logging_setup (global_opt.opt_log_level,
|
||||
global_opt.opt_log_domains,
|
||||
&bad_domains,
|
||||
&error)) {
|
||||
fprintf (stderr,
|
||||
_("%s. Please use --help to see a list of valid options.\n"),
|
||||
error->message);
|
||||
exit (1);
|
||||
} else if (bad_domains) {
|
||||
fprintf (stderr,
|
||||
_("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"),
|
||||
bad_domains);
|
||||
g_clear_pointer (&bad_domains, g_free);
|
||||
}
|
||||
|
||||
/* When running from the build directory, determine our build directory
|
||||
* base and set helper paths in the build tree */
|
||||
if (global_opt.run_from_build_dir) {
|
||||
|
|
@ -334,6 +319,21 @@ main (int argc, char *argv[])
|
|||
g_free (path);
|
||||
}
|
||||
|
||||
if (!nm_logging_setup (global_opt.opt_log_level,
|
||||
global_opt.opt_log_domains,
|
||||
&bad_domains,
|
||||
&error)) {
|
||||
fprintf (stderr,
|
||||
_("%s. Please use --help to see a list of valid options.\n"),
|
||||
error->message);
|
||||
exit (1);
|
||||
} else if (bad_domains) {
|
||||
fprintf (stderr,
|
||||
_("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"),
|
||||
bad_domains);
|
||||
g_clear_pointer (&bad_domains, g_free);
|
||||
}
|
||||
|
||||
/* Read the config file and CLI overrides */
|
||||
config = nm_config_setup (config_cli, &error);
|
||||
nm_config_cmd_line_options_free (config_cli);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue