From 62d8d6a23398044469ce722857ab409926336c88 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sat, 23 Dec 2023 15:06:20 -0700 Subject: [PATCH] undo logger none removal --- iso/empanadas/empanadas/util/dnf_utils.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/iso/empanadas/empanadas/util/dnf_utils.py b/iso/empanadas/empanadas/util/dnf_utils.py index a3ed965..98d6062 100644 --- a/iso/empanadas/empanadas/util/dnf_utils.py +++ b/iso/empanadas/empanadas/util/dnf_utils.py @@ -1806,16 +1806,17 @@ class SigRepoSync: ) # This is temporary for now. - self.log = logging.getLogger("sigreposync") - self.log.setLevel(getattr(logging, logger.upper(), 'INFO')) - handler = logging.StreamHandler(sys.stdout) - handler.setLevel(logging.INFO) - formatter = logging.Formatter( - '%(asctime)s :: %(name)s :: %(message)s', - '%Y-%m-%d %H:%M:%S' - ) - handler.setFormatter(formatter) - self.log.addHandler(handler) + if logger is None: + self.log = logging.getLogger("sigreposync") + self.log.setLevel(getattr(logging, logger.upper(), 'INFO')) + handler = logging.StreamHandler(sys.stdout) + handler.setLevel(logging.INFO) + formatter = logging.Formatter( + '%(asctime)s :: %(name)s :: %(message)s', + '%Y-%m-%d %H:%M:%S' + ) + handler.setFormatter(formatter) + self.log.addHandler(handler) self.log.info('sig reposync init') self.log.info(self.profile + ' ' + self.major_version)