Author: duncan
Date: Sat Jun  2 21:39:07 2007
New Revision: 9638

Modified:
   branches/rel-1/freevo/src/config.py

Log:
Added a _stack_ function for debugging, printing a message and a stack trace


Modified: branches/rel-1/freevo/src/config.py
==============================================================================
--- branches/rel-1/freevo/src/config.py (original)
+++ branches/rel-1/freevo/src/config.py Sat Jun  2 21:39:07 2007
@@ -278,6 +278,17 @@
     sys.stdout.log('Freevo (%s) start at %s\n' % (VERSION, ts))
     sys.stdout.log('-' * 79 + '\n')
 
+def _stack_function_(message=None, limit=None):
+    import traceback
+    if message:
+        print '%s' % (message)
+    stack = traceback.extract_stack()
+    if stack:
+        if limit:
+            print '*** %s' % ('*** 
'.join(traceback.format_list(stack[-limit-1:-1])))
+        else:
+            print '*** %s' % ('*** '.join(traceback.format_list(stack)[0:-1]))
+
 def _debug_function_(s, level=1):
     if DEBUG < level:
         return
@@ -294,6 +305,7 @@
 
 
 __builtin__.__dict__['_debug_']= _debug_function_
+__builtin__.__dict__['_stack_']= _stack_function_
 
 
 #

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to