From c2b2ffe6b9a378deaa236d6223596fd5b7b9b19b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 15 Mar 2015 16:00:36 +0100 Subject: 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. --- src/main.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main.c b/src/main.c index 73cb7acead..9d257a2408 100644 --- a/src/main.c +++ b/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); -- cgit v1.2.1