Log using `exception()`, but asynchronously in a separate thread. .. versionadded:: 23.1.0
(self, event: str, *args: Any, **kw: Any)
| 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 |