~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Martin Pool
  • Date: 2010-01-12 06:30:41 UTC
  • mfrom: (4634.119.3 2.0)
  • mto: This revision was merged to the branch mainline in revision 4951.
  • Revision ID: mbp@sourcefrog.net-20100112063041-qp2ei0clx5gh0e9e
merge 2.0 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
            bzr_log_file.write("bug reports to https://bugs.launchpad.net/bzr/+filebug\n\n")
251
251
        return bzr_log_file
252
252
    except IOError, e:
253
 
        warning("failed to open trace file: %s" % (e))
 
253
        # If we are failing to open the log, then most likely logging has not
 
254
        # been set up yet. So we just write to stderr rather than using
 
255
        # 'warning()'. If we using warning(), users get the unhelpful 'no
 
256
        # handlers registered for "bzr"' when something goes wrong on the
 
257
        # server. (bug #503886)
 
258
        sys.stderr.write("failed to open trace file: %s\n" % (e,))
254
259
    # TODO: What should happen if we fail to open the trace file?  Maybe the
255
260
    # objects should be pointed at /dev/null or the equivalent?  Currently
256
261
    # returns None which will cause failures later.