[pypy-svn] r79426 - in pypy/trunk/pypy: rlib tool

arigo at codespeak.net arigo at codespeak.net
Tue Nov 23 18:45:23 CET 2010


Author: arigo
Date: Tue Nov 23 18:45:22 2010
New Revision: 79426

Modified:
   pypy/trunk/pypy/rlib/debug.py
   pypy/trunk/pypy/tool/logparser.py
Log:
More whacking in order to make log_parse() be able to parse logs
captured during testing too.


Modified: pypy/trunk/pypy/rlib/debug.py
==============================================================================
--- pypy/trunk/pypy/rlib/debug.py	(original)
+++ pypy/trunk/pypy/rlib/debug.py	Tue Nov 23 18:45:22 2010
@@ -87,13 +87,15 @@
     _stop_colors = ""
 
 def debug_start(category):
-    print >> sys.stderr, '%s[%s] {%s%s' % (_start_colors_1, time.clock(),
+    c = int(time.clock() * 100)
+    print >> sys.stderr, '%s[%x] {%s%s' % (_start_colors_1, c,
                                            category, _stop_colors)
     if _log is not None:
         _log.debug_start(category)
 
 def debug_stop(category):
-    print >> sys.stderr, '%s[%s] %s}%s' % (_start_colors_2, time.clock(),
+    c = int(time.clock() * 100)
+    print >> sys.stderr, '%s[%x] %s}%s' % (_start_colors_2, c,
                                            category, _stop_colors)
     if _log is not None:
         _log.debug_stop(category)

Modified: pypy/trunk/pypy/tool/logparser.py
==============================================================================
--- pypy/trunk/pypy/tool/logparser.py	(original)
+++ pypy/trunk/pypy/tool/logparser.py	Tue Nov 23 18:45:22 2010
@@ -25,8 +25,9 @@
     return parse_log(lines, verbose=verbose)
 
 def parse_log(lines, verbose=False):
-    r_start = re.compile(r"\[([0-9a-fA-F]+)\] \{([\w-]+)$")
-    r_stop  = re.compile(r"\[([0-9a-fA-F]+)\] ([\w-]+)\}$")
+    color = "(?:\x1b.*?m)"
+    r_start = re.compile(color + r"\[([0-9a-fA-F]+)\] \{([\w-]+)" + color + "$")
+    r_stop  = re.compile(color + r"\[([0-9a-fA-F]+)\] ([\w-]+)\}" + color + "$")
     lasttime = 0
     log = DebugLog()
     time_decrase = False



More information about the Pypy-commit mailing list