~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Martin Pool
  • Date: 2005-05-05 06:14:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050505061453-21bd538616b8e5fc
- pychecker fixups

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
"""
24
24
 
25
25
 
26
 
import sys, os, time, socket, stat, codecs
 
26
import sys, os
27
27
import bzrlib
28
28
 
29
29
######################################################################
71
71
 
72
72
 
73
73
def _rollover_trace_maybe(trace_fname):
 
74
    import stat
74
75
    try:
75
76
        size = os.stat(trace_fname)[stat.ST_SIZE]
76
77
        if size <= 4 << 20:
98
99
    # information if something goes wrong.  In a future version this
99
100
    # file will be removed on successful completion.
100
101
    global _starttime, _tracefile
 
102
    import stat, codecs
101
103
 
102
104
    _starttime = os.times()[4]
103
105
 
132
134
 
133
135
 
134
136
 
135
 
def log_exception(e):
 
137
def log_exception():
 
138
    """Log the last exception into the trace file."""
136
139
    import traceback, cStringIO
137
140
    s = cStringIO.StringIO()
138
141
    traceback.print_exc(None, s)