~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: 2006-11-02 08:37:46 UTC
  • mfrom: (2095.5.3 dash-d)
  • Revision ID: pqm@pqm.ubuntu.com-20061102083746-d1a3a44b1d313f3a
(mbp) optional -Derror to get tracebacks on stderr

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        zero_nine,
66
66
        )
67
67
 
 
68
lazy_import(globals(), """
 
69
from bzrlib import debug
 
70
""")
 
71
 
68
72
_file_handler = None
69
73
_stderr_handler = None
70
74
_stderr_quiet = False
118
122
    _trace_file.write(out)
119
123
    # TODO: jam 20051227 Consider flushing the trace file to help debugging
120
124
    #_trace_file.flush()
121
 
debug = mutter
122
125
 
123
126
 
124
127
def _rollover_trace_maybe(trace_fname):
182
185
    errors loading plugins.
183
186
    """
184
187
    import traceback
185
 
    debug(traceback.format_exc())
 
188
    mutter(traceback.format_exc())
186
189
 
187
190
 
188
191
def enable_default_logging():
281
284
 
282
285
# TODO: Should these be specially encoding the output?
283
286
def report_user_error(exc_info, err_file):
 
287
    """Report to err_file an error that's not an internal error.
 
288
 
 
289
    These don't get a traceback unless -Derror was given.
 
290
    """
 
291
    if 'error' in debug.debug_flags:
 
292
        report_bug(exc_info, err_file)
 
293
        return
284
294
    print >>err_file, "bzr: ERROR:", str(exc_info[1])
285
295
 
286
296