I have logging function as follows.
logging.basicConfig( filename = fileName, format = \"%(levelname) -10s %(asctime)s %(message)s\", level = logging
Look at traceback module
>>> import traceback >>> def test(): >>> print "/".join( str(x[2]) for x in traceback.extract_stack() ) >>> def main(): >>> test() >>> main() /launch_new_instance/mainloop/mainloop/interact/push/runsource/runcode//main/test