From ba423a428ff8279b508951efdc20d1206c1f14c1 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Sun, 18 Feb 2024 15:08:48 +0100 Subject: [PATCH] check that logfile for logger doesn't match manager's own logfile; #212 --- pypiper/manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pypiper/manager.py b/pypiper/manager.py index 7473d97..6cae014 100644 --- a/pypiper/manager.py +++ b/pypiper/manager.py @@ -214,6 +214,10 @@ def __init__( # Set up logger logger_kwargs = logger_kwargs or {} + if logger_kwargs.get("logfile") == self.pipeline_log_file: + raise ValueError( + f"The logfile given for the pipeline manager's logger matches that which will be used by the manager itself: {self.pipeline_log_file}" + ) default_logname = ".".join([__name__, self.__class__.__name__, self.name]) self._logger = None if args: