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, )
| 30 | |
| 31 | |
| 32 | class 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 | |
| 60 | class LoggerFactory: |