MCPcopy Create free account
hub / github.com/hynek/structlog / get_merged_threadlocal

Function get_merged_threadlocal

src/structlog/threadlocal.py:242–254  ·  view source on GitHub ↗

Return a copy of the current thread-local context merged with the context from *bound_logger*. .. versionadded:: 21.2.0 .. deprecated:: 22.1.0

(bound_logger: BindableLogger)

Source from the content-addressed store, hash-verified

240
241
242def get_merged_threadlocal(bound_logger: BindableLogger) -> Context:
243 """
244 Return a copy of the current thread-local context merged with the context
245 from *bound_logger*.
246
247 .. versionadded:: 21.2.0
248 .. deprecated:: 22.1.0
249 """
250 _deprecated()
251 ctx = _get_context().copy()
252 ctx.update(structlog.get_context(bound_logger))
253
254 return ctx
255
256
257def merge_threadlocal(

Callers 1

test_get_mergedMethod · 0.90

Calls 3

_deprecatedFunction · 0.85
_get_contextFunction · 0.85
updateMethod · 0.80

Tested by 1

test_get_mergedMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…