Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'python/src/tcf/util/logging.py')
-rw-r--r--python/src/tcf/util/logging.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/python/src/tcf/util/logging.py b/python/src/tcf/util/logging.py
index 889ff3dd7..132daa931 100644
--- a/python/src/tcf/util/logging.py
+++ b/python/src/tcf/util/logging.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
"Internal utility methods used for logging/tracing."
-import cStringIO
import locale
import time
@@ -30,24 +29,24 @@ def getDebugTime():
the relative time between two events, since the counter will flip to zero
roughly every 16 minutes.
"""
- traceBuilder = cStringIO.StringIO()
+ traceBuilder = ''
# Record the time
tm = int(time.time() * 1000)
- seconds = (tm / 1000) % 1000
+ seconds = int((tm / 1000)) % 1000
if seconds < 100:
- traceBuilder.write('0')
+ traceBuilder += '0'
if seconds < 10:
- traceBuilder.write('0')
- traceBuilder.write(str(seconds))
- traceBuilder.write(DECIMAL_DELIMITER)
+ traceBuilder += '0'
+ traceBuilder += str(seconds)
+ traceBuilder += str(DECIMAL_DELIMITER)
millis = tm % 1000
if millis < 100:
- traceBuilder.write('0')
+ traceBuilder += '0'
if millis < 10:
- traceBuilder.write('0')
- traceBuilder.write(str(millis))
- return traceBuilder.getvalue()
+ traceBuilder += '0'
+ traceBuilder += str(millis)
+ return traceBuilder
def trace(msg):

Back to the top