diff --git a/django_logging/constants/config_types.py b/django_logging/constants/config_types.py index 9571764..b19ce94 100644 --- a/django_logging/constants/config_types.py +++ b/django_logging/constants/config_types.py @@ -3,11 +3,11 @@ FormatOption = Union[int, str] # Type Aliases for configurations -LogFileFormatType = Literal["JSON", "XML", "FLAT", "LOG"] +LogFileFormatType = Literal["JSON", "XML", "FLAT", "NORMAL"] LogLevel = Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] LogDir = str LogLevels = List[LogLevel] -NotifierLogLevels = List[Literal["ERROR", "CRITICAL"]] +NotifierLogLevels = List[Union[Literal["ERROR", "CRITICAL"], None]] LogDateFormat = str diff --git a/django_logging/middleware/monitor_log_size.py b/django_logging/middleware/monitor_log_size.py index 05b7c21..bda51d7 100644 --- a/django_logging/middleware/monitor_log_size.py +++ b/django_logging/middleware/monitor_log_size.py @@ -1,6 +1,5 @@ import logging from datetime import timedelta -from typing import Awaitable, Callable, Union from asgiref.sync import sync_to_async from django.core.cache import cache @@ -28,22 +27,6 @@ class MonitorLogSizeMiddleware(BaseMiddleware): """ - # pylint: disable=useless-parent-delegation - def __init__( - self, - get_response: Callable[ - [HttpRequest], Union[HttpResponseBase, Awaitable[HttpResponseBase]] - ], - ) -> None: - """Initializes the middleware with the provided get_response callable. - - Args: - ---- - get_response (callable): The next middleware or view to be called in the chain. - - """ - super().__init__(get_response) - def __sync_call__(self, request: HttpRequest) -> HttpResponseBase: """Synchronous request processing. diff --git a/django_logging/settings/conf.py b/django_logging/settings/conf.py index 3dae1ae..7e1a358 100644 --- a/django_logging/settings/conf.py +++ b/django_logging/settings/conf.py @@ -23,7 +23,7 @@ from django_logging.filters.log_level_filter import LoggingLevelFilter -# pylint: disable=too-many-instance-attributes, too-many-arguments +# pylint: disable=too-many-instance-attributes, too-many-arguments, too-many-positional-arguments class LogConfig: """Configuration class for django_logging. diff --git a/django_logging/utils/set_conf.py b/django_logging/utils/set_conf.py index 1530285..382e972 100644 --- a/django_logging/utils/set_conf.py +++ b/django_logging/utils/set_conf.py @@ -21,7 +21,7 @@ ) -# pylint: disable=too-many-arguments, too-many-locals +# pylint: disable=too-many-arguments, too-many-positional-arguments, too-many-locals def set_config( log_levels: LogLevels, log_dir: LogDir,