cisco_wifi_ctl.py : bug fix for std out

This commit is contained in:
Chuck SmileyRekiere
2020-11-19 18:29:55 -07:00
parent aa553915c1
commit b6085a02fc

View File

@@ -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))