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

Function clear_threadlocal

src/structlog/threadlocal.py:285–296  ·  view source on GitHub ↗

Clear the thread-local context. The typical use-case for this function is to invoke it early in request-handling code. .. versionadded:: 19.2.0 .. deprecated:: 22.1.0

()

Source from the content-addressed store, hash-verified

283
284
285def clear_threadlocal() -> None:
286 """
287 Clear the thread-local context.
288
289 The typical use-case for this function is to invoke it early in
290 request-handling code.
291
292 .. versionadded:: 19.2.0
293 .. deprecated:: 22.1.0
294 """
295 _deprecated()
296 _CONTEXT.context = {}
297
298
299def bind_threadlocal(**kw: Any) -> None:

Callers 2

_clear_threadlocalFunction · 0.90
test_clearMethod · 0.90

Calls 1

_deprecatedFunction · 0.85

Tested by 2

_clear_threadlocalFunction · 0.72
test_clearMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…