Changeset 2943

Show
Ignore:
Timestamp:
03/20/2007 02:33:06 PM (2 years ago)
Author:
ed
Message:

Changed the default inspect stack level to 6, which is usually the correct amount to find the actual calling method in a Dabo app.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dBug.py

    r1406 r2943  
    33 
    44def logPoint(msg="", levels=None): 
     5    if levels is None: 
     6        # Default to 6, which works in most cases 
     7        levels = 6 
    58    stack = inspect.stack() 
    69    # get rid of logPoint's part of the stack: 
     
    1114        output.write(str(msg) + "\n") 
    1215     
    13     if levels is None: 
    14         stackSection = stack 
    15     else: 
    16         stackSection = stack[-1*levels:] 
     16    stackSection = stack[-1*levels:] 
    1717    for stackLine in stackSection: 
    1818        frame, filename, line, funcname, lines, unknown = stackLine