summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-11 18:14:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-11 18:14:56 (GMT)
commitd9a29f93cd4ff505e264974febd0566ae29880ca (patch)
tree6eea9e476374863e93c80aacb76840ac24f0c50f /3rdParty/SCons/scons-local/SCons/Debug.py
parent73f845a3f380c5a1adbac2cf29e9f36cc9b498cf (diff)
downloadswift-d9a29f93cd4ff505e264974febd0566ae29880ca.zip
swift-d9a29f93cd4ff505e264974febd0566ae29880ca.tar.bz2
Update SCons to 1.3.0.d20100404.
Diffstat (limited to '3rdParty/SCons/scons-local/SCons/Debug.py')
-rw-r--r--3rdParty/SCons/scons-local/SCons/Debug.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/3rdParty/SCons/scons-local/SCons/Debug.py b/3rdParty/SCons/scons-local/SCons/Debug.py
index cc7041d..f7805eb 100644
--- a/3rdParty/SCons/scons-local/SCons/Debug.py
+++ b/3rdParty/SCons/scons-local/SCons/Debug.py
@@ -7,7 +7,7 @@ needed by most users.
"""
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,11 +29,12 @@ needed by most users.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Debug.py 4043 2009/02/23 09:06:45 scons"
+__revision__ = "src/engine/SCons/Debug.py 4761 2010/04/04 14:04:44 bdeegan"
import os
import string
import sys
+import time
# Recipe 14.10 from the Python Cookbook.
try:
@@ -196,14 +197,24 @@ if sys.platform == 'win32':
else:
TraceDefault = '/dev/tty'
-def Trace(msg, file=None, mode='w'):
+TimeStampDefault = None
+StartTime = time.time()
+PreviousTime = StartTime
+
+def Trace(msg, file=None, mode='w', tstamp=None):
"""Write a trace message to a file. Whenever a file is specified,
it becomes the default for the next call to Trace()."""
global TraceDefault
+ global TimeStampDefault
+ global PreviousTime
if file is None:
file = TraceDefault
else:
TraceDefault = file
+ if tstamp is None:
+ tstamp = TimeStampDefault
+ else:
+ TimeStampDefault = tstamp
try:
fp = TraceFP[file]
except KeyError:
@@ -212,6 +223,10 @@ def Trace(msg, file=None, mode='w'):
except TypeError:
# Assume we were passed an open file pointer.
fp = file
+ if tstamp:
+ now = time.time()
+ fp.write('%8.4f %8.4f: ' % (now - StartTime, now - PreviousTime))
+ PreviousTime = now
fp.write(msg)
fp.flush()