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

Method aexception

src/structlog/stdlib.py:521–532  ·  view source on GitHub ↗

Log using `exception()`, but asynchronously in a separate thread. .. versionadded:: 23.1.0

(self, event: str, *args: Any, **kw: Any)

Source from the content-addressed store, hash-verified

519 await self._dispatch_to_sync(self.critical, event, args, kw)
520
521 async def aexception(self, event: str, *args: Any, **kw: Any) -> None:
522 """
523 Log using `exception()`, but asynchronously in a separate thread.
524
525 .. versionadded:: 23.1.0
526 """
527 # To make `log.exception("foo") work, we have to check if the user
528 # passed an explicit exc_info and if not, supply our own.
529 if kw.get("exc_info", True) is True and kw.get("exception") is None:
530 kw["exc_info"] = sys.exc_info()
531
532 await self._dispatch_to_sync(self.exception, event, args, kw)
533
534 async def alog(
535 self, level: Any, event: str, *args: Any, **kw: Any

Calls 1

_dispatch_to_syncMethod · 0.95