From 8e98a44a7fa54901824947340fc2095dec95a03c Mon Sep 17 00:00:00 2001 From: maurane glaude Date: Fri, 28 Aug 2026 14:58:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84style(logging):=20rename=20`logging?= =?UTF-8?q?`=20by=20`logging=5Fconfig`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit naming the logging module of logwatcher like the built-in python package is confusing. By naming it `logging_config`, everything is explicit. --- src/logwatcher/__init__.py | 4 ++-- src/logwatcher/app.py | 6 ++++-- src/logwatcher/{logging.py => logging_config.py} | 0 tests/conftest.py | 2 +- tests/test_logging.py | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) rename src/logwatcher/{logging.py => logging_config.py} (100%) diff --git a/src/logwatcher/__init__.py b/src/logwatcher/__init__.py index 2ec9f74..b53958a 100644 --- a/src/logwatcher/__init__.py +++ b/src/logwatcher/__init__.py @@ -1,4 +1,4 @@ from logwatcher.config import * -from logwatcher.logging import setup_logging +from logwatcher.logging_config import setup_logging -logger = setup_logging() +logger = setup_logging() diff --git a/src/logwatcher/app.py b/src/logwatcher/app.py index 7be2e0b..adff7cb 100644 --- a/src/logwatcher/app.py +++ b/src/logwatcher/app.py @@ -3,7 +3,9 @@ from logwatcher import logger def app(): logger.info("logwatcher starts its work.") - logger.info('logwatcher has finished its task.') + print("hello, world!") + logger.info("logwatcher has finished its task.") + if __name__ == "__main__": - app() \ No newline at end of file + app() diff --git a/src/logwatcher/logging.py b/src/logwatcher/logging_config.py similarity index 100% rename from src/logwatcher/logging.py rename to src/logwatcher/logging_config.py diff --git a/tests/conftest.py b/tests/conftest.py index dda3d18..704b404 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,7 +5,7 @@ from pathlib import Path import pytest from logwatcher.config import FIXTURE_PATH -from logwatcher.logging import setup_logging +from logwatcher.logging_config import setup_logging # original log directory ORIGINAL_LOG_DIR = FIXTURE_PATH / "original_logs" diff --git a/tests/test_logging.py b/tests/test_logging.py index e6e15f6..45cad44 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -14,7 +14,7 @@ from logging import DEBUG, ERROR, INFO, WARNING, FileHandler, StreamHandler, get import pytest from logwatcher import logger -from logwatcher.logging import _setup_formatter, _setup_handler, setup_logging +from logwatcher.logging_config import _setup_formatter, _setup_handler, setup_logging def test_setup_handler(tmp_log_file):