import logging

try:
    do-something-block
except:
    logging.exception("Exception Logged")

 

相关文章: