Debug

Printing the current running stack in Python - Blog

import traceback
import logging

# somewhere in your buggy code
logging.log(1, "".join(traceback.format_stack())