Skip to content

Commit

Permalink
⚡ Update codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
MEHRSHAD-MIRSHEKARY committed Oct 15, 2024
1 parent 7eb7f8e commit 43ef34d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
4 changes: 2 additions & 2 deletions django_logging/constants/config_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
17 changes: 0 additions & 17 deletions django_logging/middleware/monitor_log_size.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion django_logging/settings/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion django_logging/utils/set_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 43ef34d

Please sign in to comment.