~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Alexander Belchenko
  • Date: 2008-01-28 22:22:13 UTC
  • mfrom: (3201 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3230.
  • Revision ID: bialix@ukr.net-20080128222213-gitken71eyvdd203
merge bzr.dev

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()