~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:21:22 UTC
  • Revision ID: mbp@sourcefrog.net-20050505062122-2043480e9e439807
- use cgitb to get more detailed traceback in the 
  trace file

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
 
137
137
def log_exception():
138
138
    """Log the last exception into the trace file."""
139
 
    import traceback, cStringIO
140
 
    s = cStringIO.StringIO()
141
 
    traceback.print_exc(None, s)
142
 
    for l in s.getvalue().split('\n'):
 
139
    import cgitb
 
140
    s = cgitb.text(sys.exc_info())
 
141
    for l in s.split('\n'):
143
142
        _write_trace(l)
144
143
        
145
144