From 6c3a71db881d005de98d3b6d590044561f0d99f5 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Mon, 10 Apr 2023 09:15:14 -0400 Subject: [PATCH 1/2] Don't call `logging.basicConfig()` in `__init__.py` --- heudiconv/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/heudiconv/__init__.py b/heudiconv/__init__.py index 4015e511..83b70495 100644 --- a/heudiconv/__init__.py +++ b/heudiconv/__init__.py @@ -1,16 +1,9 @@ -# set logger handler import logging -import os from ._version import __version__ from .info import __packagename__ __all__ = ["__packagename__", "__version__"] -# Rudimentary logging support. lgr = logging.getLogger(__name__) -logging.basicConfig( - format="%(levelname)s: %(message)s", - level=getattr(logging, os.environ.get("HEUDICONV_LOG_LEVEL", "INFO")), -) lgr.debug("Starting the abomination") # just to "run-test" logging From e526de008983ae3bd304765975a95aeb6430d986 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Wed, 12 Apr 2023 08:22:48 -0400 Subject: [PATCH 2/2] Call `logging.basicConfig()` in `heudiconv/cli/run.py` --- heudiconv/cli/run.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/heudiconv/cli/run.py b/heudiconv/cli/run.py index fd74c001..1bb1d0d9 100644 --- a/heudiconv/cli/run.py +++ b/heudiconv/cli/run.py @@ -12,6 +12,10 @@ def main(argv=None): + logging.basicConfig( + format="%(levelname)s: %(message)s", + level=getattr(logging, os.environ.get("HEUDICONV_LOG_LEVEL", "INFO")), + ) parser = get_parser() args = parser.parse_args(argv) # exit if nothing to be done