fix logger no longer applying to clan_lib

with moving code to clan_lib we are missing logging for some output. To
fix this we remove the module scoping from the logger and just set one
global logger.
This commit is contained in:
Jörg Thalheim
2025-05-20 09:55:19 +02:00
parent 6e898a2c10
commit 5d99fb1e47
7 changed files with 18 additions and 24 deletions

View File

@@ -23,11 +23,9 @@ class ClanAppOptions:
@profile
def app_run(app_opts: ClanAppOptions) -> int:
if app_opts.debug:
setup_logging(logging.DEBUG, root_log_name=__name__.split(".")[0])
setup_logging(logging.DEBUG, root_log_name="clan_cli")
setup_logging(logging.DEBUG)
else:
setup_logging(logging.INFO, root_log_name=__name__.split(".")[0])
setup_logging(logging.INFO, root_log_name="clan_cli")
setup_logging(logging.INFO)
log.debug("Debug mode enabled")

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import logging
import subprocess
from pathlib import Path
@@ -22,7 +23,7 @@ def pytest_sessionstart(session: pytest.Session) -> None:
# You can access the session config, items, testsfailed, etc.
print(f"Session config: {session.config}")
setup_logging(level="DEBUG")
setup_logging(logging.DEBUG)
# fixture for git_repo