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 = logging.getLogger(__name__)
logg.setLevel(logging.DEBUG) logg.setLevel(logging.DEBUG)
file_handler = None file_handler = None
if (logfile is not None): if (logfile != "stdout"):
if (logfile != "stdout"): file_handler = logging.FileHandler(logfile, "w")
file_handler = logging.FileHandler(logfile, "w") file_handler.setLevel(logging.DEBUG)
file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter)
file_handler.setFormatter(formatter) logg.addHandler(file_handler)
logg.addHandler(file_handler) logging.basicConfig(format=FORMAT, handlers=[console_handler])
logging.basicConfig(format=FORMAT, handlers=[console_handler]) else:
else: # stdout logging
# stdout logging logging.basicConfig(format=FORMAT, handlers=[console_handler])
logging.basicConfig(format=FORMAT, handlers=[console_handler])
logg.info("cisco series {}".format(args.series)) logg.info("cisco series {}".format(args.series))
logg.info("scheme {}".format(args.scheme)) logg.info("scheme {}".format(args.scheme))