commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8694 - trunk/gnue-common/src/apps


From: reinhard
Subject: [gnue] r8694 - trunk/gnue-common/src/apps
Date: Mon, 25 Sep 2006 04:27:23 -0500 (CDT)

Author: reinhard
Date: 2006-09-25 04:27:22 -0500 (Mon, 25 Sep 2006)
New Revision: 8694

Modified:
   trunk/gnue-common/src/apps/GDebug.py
Log:
Changed timestamps in debug messages to absolute time.

issue121 testing


Modified: trunk/gnue-common/src/apps/GDebug.py
===================================================================
--- trunk/gnue-common/src/apps/GDebug.py        2006-09-22 16:24:56 UTC (rev 
8693)
+++ trunk/gnue-common/src/apps/GDebug.py        2006-09-25 09:27:22 UTC (rev 
8694)
@@ -26,10 +26,6 @@
 messages to a file.
 """
 
-# Do this at the very start so we lose as little time as possible
-import time
-__starttime = time.time ()
-
 import sys, os
 if '--debug-imports' in sys.argv or os.environ.has_key('GNUE_DEBUG_IMPORT'):
   from gnue.common.apps import GImportLogger
@@ -39,6 +35,7 @@
 import os
 import string
 import sys
+import time
 import traceback
 import types
 
@@ -152,10 +149,10 @@
 
   global _fh, _DEBUGGER
 
-  s = time.time () - __starttime
-  (m, s) = divmod (s, 60)
-  (h, m) = divmod (m, 60)
-  stamp  = "%d:%02d:%06.3f" % (h, m, s)
+  s = time.time ()
+  msecs = (s - long (s)) * 1000
+  t = time.strftime ('%Y-%m-%d %H:%M:%S', time.localtime (s))
+  stamp = "%s.%03d" % (t, msecs)
 
   lines = "%s" % message
   for line in lines.splitlines ():





reply via email to

[Prev in Thread] Current Thread [Next in Thread]