diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 883162ab..3b561c23 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -139,16 +139,15 @@ def main(): logg = logging.getLogger(__name__) logg.setLevel(logging.DEBUG) file_handler = None - if (logfile is not None): - if (logfile != "stdout"): - file_handler = logging.FileHandler(logfile, "w") - file_handler.setLevel(logging.DEBUG) - file_handler.setFormatter(formatter) - logg.addHandler(file_handler) - logging.basicConfig(format=FORMAT, handlers=[console_handler]) - else: - # stdout logging - logging.basicConfig(format=FORMAT, handlers=[console_handler]) + if (logfile != "stdout"): + file_handler = logging.FileHandler(logfile, "w") + file_handler.setLevel(logging.DEBUG) + file_handler.setFormatter(formatter) + logg.addHandler(file_handler) + logging.basicConfig(format=FORMAT, handlers=[console_handler]) + else: + # stdout logging + logging.basicConfig(format=FORMAT, handlers=[console_handler]) logg.info("cisco series {}".format(args.series)) logg.info("scheme {}".format(args.scheme))