main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -14,8 +14,6 @@ probably change to something more elegant.
from __future__ import annotations
import sys
from types import TracebackType
from typing import (
Any,
@@ -33,12 +31,6 @@ from typing import (
)
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self
WrappedLogger = Any
"""
A logger that is wrapped by a bound logger and is ultimately responsible for
@@ -68,15 +60,11 @@ copy itself.
.. versionadded:: 20.2.0
"""
ProcessorReturnValue = Union[
Mapping[str, Any], str, bytes, bytearray, Tuple[Any, ...]
Processor = Callable[
[WrappedLogger, str, EventDict],
Union[Mapping[str, Any], str, bytes, bytearray, Tuple[Any, ...]],
]
"""
A value returned by a processor.
"""
Processor = Callable[[WrappedLogger, str, EventDict], ProcessorReturnValue]
"""
A callable that is part of the processor chain.
See :doc:`processors`.
@@ -114,17 +102,20 @@ class ExceptionTransformer(Protocol):
Used by `structlog.processors.format_exc_info()` and
`structlog.processors.ExceptionPrettyPrinter`.
Args:
Arguments:
exc_info: Is the exception tuple to format
Returns:
Anything that can be rendered by the last processor in your chain, for
example, a string or a JSON-serializable structure.
Anything that can be rendered by the last processor in your chain,
for example, a string or a JSON-serializable structure.
.. versionadded:: 22.1.0
"""
def __call__(self, exc_info: ExcInfo) -> Any: ...
def __call__(self, exc_info: ExcInfo) -> Any:
...
@runtime_checkable
@@ -138,13 +129,17 @@ class BindableLogger(Protocol):
_context: Context
def bind(self, **new_values: Any) -> Self: ...
def bind(self, **new_values: Any) -> BindableLogger:
...
def unbind(self, *keys: str) -> Self: ...
def unbind(self, *keys: str) -> BindableLogger:
...
def try_unbind(self, *keys: str) -> Self: ...
def try_unbind(self, *keys: str) -> BindableLogger:
...
def new(self, **new_values: Any) -> Self: ...
def new(self, **new_values: Any) -> BindableLogger:
...
class FilteringBoundLogger(BindableLogger, Protocol):
@@ -190,20 +185,6 @@ class FilteringBoundLogger(BindableLogger, Protocol):
.. versionadded:: 22.1.0
"""
def is_enabled_for(self, level: int) -> bool:
"""
Check whether the logger is enabled for *level*.
.. versionadded:: 25.1.0
"""
def get_effective_level(self) -> int:
"""
Return the effective level of the logger.
.. versionadded:: 25.1.0
"""
def debug(self, event: str, *args: Any, **kw: Any) -> Any:
"""
Log ``event % args`` with **kw** at **debug** level.