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

Function get_context

src/structlog/_base.py:229–245  ·  view source on GitHub ↗

Return *bound_logger*'s context. The type of *bound_logger* and the type returned depend on your configuration. Args: bound_logger: The bound logger whose context you want. Returns: The *actual* context from *bound_logger*. It is *not* copied first. .. ve

(bound_logger: BindableLogger)

Source from the content-addressed store, hash-verified

227
228
229def get_context(bound_logger: BindableLogger) -> Context:
230 """
231 Return *bound_logger*'s context.
232
233 The type of *bound_logger* and the type returned depend on your
234 configuration.
235
236 Args:
237 bound_logger: The bound logger whose context you want.
238
239 Returns:
240 The *actual* context from *bound_logger*. It is *not* copied first.
241
242 .. versionadded:: 20.2.0
243 """
244 # This probably will get more complicated in the future.
245 return bound_logger._context

Callers 5

test_proxies_bindMethod · 0.90
test_proxies_newMethod · 0.90
test_proxies_unbindMethod · 0.90
test_new_clears_stateMethod · 0.90

Calls

no outgoing calls

Tested by 5

test_proxies_bindMethod · 0.72
test_proxies_newMethod · 0.72
test_proxies_unbindMethod · 0.72
test_new_clears_stateMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…