Skip to content
Snippets Groups Projects
Commit 54659cca authored by Owen Jones's avatar Owen Jones
Browse files

needed to shuffle order as args.log is now only set if flag is set

parent fbbca996
No related branches found
No related tags found
No related merge requests found
...@@ -119,14 +119,14 @@ def main() -> int: ...@@ -119,14 +119,14 @@ def main() -> int:
return 1 return 1
# Check if azure CLI tools installed # Check if azure CLI tools installed
logger.debug("Checking azure tools installed") # logger.debug("Checking azure tools installed")
tools = run_subprocess(["az"]) # tools = run_subprocess(["az"])
if tools.returncode == 1: # if tools.returncode == 1:
logger.error("Azure CLI tools need to be installed") # logger.error("Azure CLI tools need to be installed")
return 1 # return 1
else: # else:
logger.debug("Azure CLI tools installed") # logger.debug("Azure CLI tools installed")
need_login = False need_login = False
...@@ -305,12 +305,12 @@ if __name__ == "__main__": ...@@ -305,12 +305,12 @@ if __name__ == "__main__":
filename=pathlib.Path().home() / "csctcloud-connect.log", filename=pathlib.Path().home() / "csctcloud-connect.log",
encoding="utf-8", encoding="utf-8",
) )
file.setLevel(getattr(logging, args.log.upper(), logging.ERROR)) file.setLevel((getattr(logging, args.log) if args.log else logging.ERROR))
file.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(message)s")) file.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(message)s"))
logger.addHandler(file) logger.addHandler(file)
stream = logging.StreamHandler(sys.stdout) stream = logging.StreamHandler(sys.stdout)
stream.setLevel(getattr(logging, args.log.upper(), logging.INFO)) stream.setLevel((getattr(logging, args.log) if args.log else logging.INFO))
stream.setFormatter(TerminalFormatter()) stream.setFormatter(TerminalFormatter())
logger.addHandler(stream) logger.addHandler(stream)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment