This module provides an easy way to debug broken code.
from great_justice import what_happen
try:
# ...
except:
what_happen()
Or make it even better:
from great_justice import take_your_time
with take_your_time():
# ...
Results:
To get a nice debug log just pass a logger object:
from great_justice import what_happen
import logging
logger = logging.getLogger(__name__)
try:
# ...
except:
what_happen(logger=logger)