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

@@ -83,7 +83,8 @@ def wrap_dict(dict_class: type[Context]) -> type[Context]:
The wrapped class and used to keep global in the current thread.
Args:
Arguments:
dict_class: Class used for keeping context.
.. deprecated:: 22.1.0
@@ -105,18 +106,20 @@ def as_immutable(logger: TLLogger) -> TLLogger:
"""
Extract the context from a thread local logger into an immutable logger.
Args:
Arguments:
logger (structlog.typing.BindableLogger):
A logger with *possibly* thread local state.
Returns:
:class:`~structlog.BoundLogger` with an immutable context.
.. deprecated:: 22.1.0
"""
_deprecated()
if isinstance(logger, BoundLoggerLazyProxy):
logger = logger.bind()
logger = logger.bind() # type: ignore[assignment]
try:
ctx = logger._context._tl.dict_.__class__( # type: ignore[union-attr]
@@ -147,12 +150,9 @@ def tmp_bind(
.. deprecated:: 22.1.0
"""
_deprecated()
if isinstance(logger, BoundLoggerLazyProxy):
logger = logger.bind()
saved = as_immutable(logger)._context
try:
yield logger.bind(**tmp_values)
yield logger.bind(**tmp_values) # type: ignore[misc]
finally:
logger._context.clear()
logger._context.update(saved)