Skip to content

Commit 66f420f

Browse files
committed
FIX: Do not add handlers to the CLI logger twice
1 parent d1dabba commit 66f420f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fmriprep/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,10 @@ def init(cls):
604604
"""
605605
from nipype import config as ncfg
606606

607-
_handler = logging.StreamHandler(stream=sys.stdout)
608-
_handler.setFormatter(logging.Formatter(fmt=cls._fmt, datefmt=cls._datefmt))
609-
cls.cli.addHandler(_handler)
607+
if not cls.cli.hasHandlers():
608+
_handler = logging.StreamHandler(stream=sys.stdout)
609+
_handler.setFormatter(logging.Formatter(fmt=cls._fmt, datefmt=cls._datefmt))
610+
cls.cli.addHandler(_handler)
610611
cls.default.setLevel(execution.log_level)
611612
cls.cli.setLevel(execution.log_level)
612613
cls.interface.setLevel(execution.log_level)

0 commit comments

Comments
 (0)