debrepack.py: Fixed the log duplication issue

Check the handles of logger before setting it
to avoid log duplication

Story: 2008846
Task: 45276

Test Plan:
Pass: build packages and check the log in /localdisk/builder.log
      There should be no duplicated log of debrepack module

Signed-off-by: hbai <haiqing.bai@windriver.com>
Change-Id: I9924081df8eb7d7d076dc7af591fb5ae48dc2207
This commit is contained in:
hbai 2022-05-05 15:32:05 +08:00
parent b7ecbcc3ba
commit 359926d373

View File

@ -233,7 +233,8 @@ class Parser():
def __init__(self, basedir, output, log_level='info', srcrepo=None, btype="std"):
self.logger = logging.getLogger(__name__)
utils.set_logger(self.logger, log_level=log_level)
if not self.logger.handlers:
utils.set_logger(self.logger, log_level=log_level)
self.strategy = "cengn_first"
if CENGN_STRATEGY is not None: