mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-10 18:20:37 +01: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.
(cherry picked from commit 7fe0f349ce)
This commit is contained in:
parent
06d038cd58
commit
b24d44cb2d
1 changed files with 15 additions and 15 deletions
30
src/main.c
30
src/main.c
|
|
@ -289,21 +289,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) {
|
||||
|
|
@ -328,6 +313,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_new (&error);
|
||||
if (config == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue