Printing the current running stack in Python

The traceback module has utility functions for printing the currently running stack, not just tracebacks.

import traceback
import logging

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

You should follow me on twitter here

One Response to “Printing the current running stack in Python”

  1. cubrikaska writes:

    Sois absolutamente derechos. En esto algo es la idea excelente, mantengo.

Leave a Reply