From b1fc8b4281a2a2980b077449e9408a1d9719872c Mon Sep 17 00:00:00 2001 From: Kirill Zhukov Date: Fri, 30 Dec 2022 16:25:42 +0100 Subject: [PATCH] Removed unnecessary log handlers --- albs_oval_errata_diff.py | 3 ++- albs_oval_errata_diff/start.py | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/albs_oval_errata_diff.py b/albs_oval_errata_diff.py index 206d00d..c70fd0c 100644 --- a/albs_oval_errata_diff.py +++ b/albs_oval_errata_diff.py @@ -7,5 +7,6 @@ from albs_oval_errata_diff.start import start try: YAML_PATH = sys.argv[1] except IndexError: - print(f"Usage {sys.argv[0]} config.yml") + print(f"Usage: {sys.argv[0]} config.yml") + sys.exit(1) start(YAML_PATH) diff --git a/albs_oval_errata_diff/start.py b/albs_oval_errata_diff/start.py index bcccb23..8b681c8 100644 --- a/albs_oval_errata_diff/start.py +++ b/albs_oval_errata_diff/start.py @@ -89,12 +89,9 @@ def start(yaml_path: str): path.parent.mkdir() # configuring logging - handlers = [logging.FileHandler(config.log_file, mode='a'), - logging.StreamHandler(), - RotatingFileHandler(config.log_file, maxBytes=10000, backupCount=3)] logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(funcName)s %(message)s', - handlers=handlers) + handlers=[RotatingFileHandler(config.log_file, maxBytes=10000000, backupCount=3)]) logging.info("Trying to load diff file from disk") try: