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

Class BoundLogger

src/structlog/twisted.py:32–57  ·  view source on GitHub ↗

Twisted-specific version of `structlog.BoundLogger`. Works exactly like the generic one except that it takes advantage of knowing the logging methods in advance. Use it like:: configure( wrapper_class=structlog.twisted.BoundLogger, )

Source from the content-addressed store, hash-verified

30
31
32class BoundLogger(BoundLoggerBase):
33 """
34 Twisted-specific version of `structlog.BoundLogger`.
35
36 Works exactly like the generic one except that it takes advantage of
37 knowing the logging methods in advance.
38
39 Use it like::
40
41 configure(
42 wrapper_class=structlog.twisted.BoundLogger,
43 )
44
45 """
46
47 def msg(self, event: str | None = None, **kw: Any) -> Any:
48 """
49 Process event and call ``log.msg()`` with the result.
50 """
51 return self._proxy_to_logger("msg", event, **kw)
52
53 def err(self, event: str | None = None, **kw: Any) -> Any:
54 """
55 Process event and call ``log.err()`` with the result.
56 """
57 return self._proxy_to_logger("err", event, **kw)
58
59
60class LoggerFactory:

Callers 1

build_blFunction · 0.90

Calls

no outgoing calls

Tested by 1

build_blFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…