diff --git a/MANIFEST.in b/MANIFEST.in index d5aef060..8c2423a5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -recursive-include imagedephi *.yaml *.j2 +recursive-include imagedephi *.yaml *.j2 logging.conf prune .github prune docs diff --git a/imagedephi/utils/logger.py b/imagedephi/utils/logger.py index 433f9ec1..2906d361 100644 --- a/imagedephi/utils/logger.py +++ b/imagedephi/utils/logger.py @@ -1,6 +1,15 @@ +import importlib.resources import logging import logging.config +import os -logging.config.fileConfig("logging.conf") +try: + logging.config.fileConfig( + "logging.conf" + if os.path.exists("logging.conf") + else importlib.resources.files("imagedephi") / "logging.conf" + ) +except KeyError: + pass logger = logging.getLogger("root")