Avoid unwanted log messages during startup.
[paraslash.git] / server.c
index f3d5237..31d29c7 100644 (file)
--- a/server.c
+++ b/server.c
@@ -236,13 +236,13 @@ void parse_config_or_die(int override)
                        .print_errors = !conf.daemon_given
                };
                server_cmdline_parser_config_file(cf, &conf, &params);
+               daemon_set_loglevel(conf.loglevel_arg);
                conf.daemon_given = tmp;
        }
        if (conf.logfile_given) {
                daemon_set_logfile(conf.logfile_arg);
                daemon_open_log_or_die();
        }
-       daemon_set_loglevel(conf.loglevel_arg);
        init_colors_or_die();
        daemon_set_flag(DF_LOG_PID);
        daemon_set_flag(DF_LOG_LL);
@@ -490,6 +490,7 @@ static void server_init(int argc, char **argv)
        server_cmdline_parser_ext(argc, argv, &conf, &params);
        HANDLE_VERSION_FLAG("server", conf);
        drop_privileges_or_die(conf.user_arg, conf.group_arg);
+       daemon_set_loglevel(conf.loglevel_arg);
        /* parse config file, open log and set defaults */
        parse_config_or_die(0);
        log_welcome("para_server");