~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-23 00:25:58 UTC
  • mfrom: (3195.1.3 always-trace-times)
  • Revision ID: pqm@pqm.ubuntu.com-20080123002558-oeppeqc0v0etytb5
(andrew) Always include timestamps in the trace file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
_trace_depth = 0
84
84
_bzr_log_file = None
85
85
_bzr_log_filename = None
86
 
_bzr_log_opened = None
 
86
_start_time = bzrlib._start_time
87
87
 
88
88
 
89
89
# configure convenient aliases for output routines
128
128
        out = fmt % tuple(real_args)
129
129
    else:
130
130
        out = fmt
131
 
    out += '\n'
132
 
    if 'times' in debug.debug_flags:
133
 
        global _bzr_log_opened
134
 
        if _bzr_log_opened is None:
135
 
            # This is the first mutter since the process started.  Start the
136
 
            # clock from now.
137
 
            _bzr_log_opened = time.time()
138
 
        timestamp = '%0.3f' % (time.time() - _bzr_log_opened,)
139
 
        out = '%s %s' % (timestamp, out)
 
131
    timestamp = '%0.3f  ' % (time.time() - _start_time,)
 
132
    out = timestamp + out + '\n'
140
133
    _trace_file.write(out)
141
134
    # TODO: jam 20051227 Consider flushing the trace file to help debugging
142
135
    #_trace_file.flush()