📅  最后修改于: 2022-03-11 14:45:06.282000             🧑  作者: Mango
# Get Python error information with debug output
# logger.exception outputs a stack trace alongside the error message.
# Example
import logging
try:
1/0
except ZeroDivisionError:
logging.exception("error_log")
# Outputs
ERROR:root:error_log
Traceback (most recent call last):
File "", line 2, in
ZeroDivisionError: integer division or modulo by zero