Pull requests

#66 Merged
Repository
techtonik techtonik
Branch
default
Repository
scons scons
Branch
default

Make Debug.caller_stack() return full stack.

Author
  1. anatoly techtonik
Reviewers
Description
No description

Comments (2)

  1. Gary Oberbrunner

    This looks useful (better debuggability is a big thing for me), but I'm not sure when or from where this caller_stack function gets called. Could you add a simple test case? Just paste in a SConstruct that should trigger it if you want.

  2. anatoly techtonik author

    You insert it as a debug statement when you're debugging who is calling your function. For example, I want to see what is the top command that resulted in initialization of config in roundup. I insert pprint(caller_stack()) in to configuration.Config.init and receive the following output:

    ['demo.py:200(<module>)',
     'demo.py:196(main)',
     'demo.py:140(run_demo)',
     'E:\\p\\p\\roundup\\roundup\\scripts\\roundup_server.py:934(run)',
     'E:\\p\\p\\roundup\\roundup\\scripts\\roundup_server.py:589(get_server)',
     'E:\\p\\p\\roundup\\roundup\\instance.py:303(open)',
     'E:\\p\\p\\roundup\\roundup\\instance.py:55(__init__)',
     'E:\\p\\p\\roundup\\roundup\\configuration.py:1355(__init__)',
     'E:\\p\\p\\roundup\\roundup\\configuration.py:959(__init__)',
     'E:\\p\\p\\roundup\\roundup\\configuration.py:1421(load)']