From 15f6255fdd0df369909ab8e524d0d174537b2a65 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 17 May 2018 14:04:25 -0700 Subject: ovs-vsctl, ovn-nbctl, ovn-sbctl, vtep-ctl: Parse options before logging. These utilities logged the command very early, before parsing the options or the command. This meant that logging options (like --log-file or -vsyslog:off) weren't considered for the purpose of logging the command. This fixes the problem. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- vtep/vtep-ctl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'vtep') diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c index 0ae7d4621..c89ec5034 100644 --- a/vtep/vtep-ctl.c +++ b/vtep/vtep-ctl.c @@ -99,7 +99,6 @@ main(int argc, char *argv[]) struct shash local_options; unsigned int seqno; size_t n_commands; - char *args; set_program_name(argv[0]); fatal_ignore_sigpipe(); @@ -108,15 +107,14 @@ main(int argc, char *argv[]) vtep_ctl_cmd_init(); - /* Log our arguments. This is often valuable for debugging systems. */ - args = process_escape_args(argv); - VLOG(ctl_might_write_to_db(argv) ? VLL_INFO : VLL_DBG, "Called as %s", args); - /* Parse command line. */ + char *args = process_escape_args(argv); shash_init(&local_options); parse_options(argc, argv, &local_options); commands = ctl_parse_commands(argc - optind, argv + optind, &local_options, &n_commands); + VLOG(ctl_might_write_to_db(commands, n_commands) ? VLL_INFO : VLL_DBG, + "Called as %s", args); if (timeout) { time_alarm(timeout); -- cgit v1.2.1