Browse Source

added printStack and printVerboseStack

Darren Ranalli 19 years ago
parent
commit
70076bfe26
1 changed files with 7 additions and 0 deletions
  1. 7 0
      direct/src/showbase/PythonUtil.py

+ 7 - 0
direct/src/showbase/PythonUtil.py

@@ -143,6 +143,11 @@ class StackTrace:
         r+="***** NOTE: This is not a crash. This is a debug stack trace. *****"
         r+="***** NOTE: This is not a crash. This is a debug stack trace. *****"
         return r
         return r
 
 
+def printStack():
+    print StackTrace(start=1).compact()
+def printVerboseStack():
+    print StackTrace(start=1)
+
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 
 
 def traceFunctionCall(frame):
 def traceFunctionCall(frame):
@@ -2684,3 +2689,5 @@ __builtin__.rad90 = rad90
 __builtin__.rad180 = rad180
 __builtin__.rad180 = rad180
 __builtin__.rad270 = rad270
 __builtin__.rad270 = rad270
 __builtin__.rad360 = rad360
 __builtin__.rad360 = rad360
+__builtin__.printStack = printStack
+__builtin__.printVerboseStack = printVerboseStack