log_exception

caqtus.utils.log_exception(
logger: Logger,
exec_info: bool = True,
) Callable[[Callable[[_P], _T]], Callable[[_P], _T]]

Decorator to log exceptions raised by a function.

Parameters:
  • logger – The logger to use to record the exception.

  • exec_info – If True, the exception information will be added to the log record.