Logging exceptions with traceback in python

When using logging module one often need to print traceback along with error message.
Solution is:
logger.error('error message',  exc_info=True)  # for adding traceback to log

Equivalent :
logger. exception('message') 

No comments:

Post a Comment