106
106
_rollover_trace_maybe(trace_fname)
108
108
# buffering=1 means line buffered
109
_tracefile = codecs.open(trace_fname, 'at', 'utf8', buffering=1)
112
if os.fstat(t.fileno())[stat.ST_SIZE] == 0:
113
t.write("\nthis is a debug log for diagnosing/reporting problems in bzr\n")
114
t.write("you can delete or truncate this file, or include sections in\n")
115
t.write("bug reports to bazaar-ng@lists.canonical.com\n\n")
118
_write_trace('bzr %s invoked on python %s (%s)'
119
% (bzrlib.__version__,
120
'.'.join(map(str, sys.version_info)),
123
_write_trace(' arguments: %r' % argv)
124
_write_trace(' working dir: ' + os.getcwdu())
110
_tracefile = codecs.open(trace_fname, 'at', 'utf8', buffering=1)
113
if os.fstat(t.fileno())[stat.ST_SIZE] == 0:
114
t.write("\nthis is a debug log for diagnosing/reporting problems in bzr\n")
115
t.write("you can delete or truncate this file, or include sections in\n")
116
t.write("bug reports to bazaar-ng@lists.canonical.com\n\n")
119
_write_trace('bzr %s invoked on python %s (%s)'
120
% (bzrlib.__version__,
121
'.'.join(map(str, sys.version_info)),
124
_write_trace(' arguments: %r' % argv)
125
_write_trace(' working dir: ' + os.getcwdu())
127
warning("failed to open trace file: %s" % (e))
127
129
def close_trace():
128
130
times = os.times()