~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: 2010-03-24 07:27:44 UTC
  • mfrom: (5094.3.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100324072744-2fod6mq1jqijs7c0
(mbp, for parthm) inherit permissions on \~/.bazaar etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
    _bzr_log_filename = _get_bzr_log_filename()
242
242
    _rollover_trace_maybe(_bzr_log_filename)
243
243
    try:
244
 
        bzr_log_file = open(_bzr_log_filename, 'at', buffering=0) # unbuffered
 
244
        buffering = 0 # unbuffered
 
245
        bzr_log_file = osutils.open_with_ownership(_bzr_log_filename, 'at', buffering)
245
246
        # bzr_log_file.tell() on windows always return 0 until some writing done
246
247
        bzr_log_file.write('\n')
247
248
        if bzr_log_file.tell() <= 2:
248
249
            bzr_log_file.write("this is a debug log for diagnosing/reporting problems in bzr\n")
249
250
            bzr_log_file.write("you can delete or truncate this file, or include sections in\n")
250
251
            bzr_log_file.write("bug reports to https://bugs.launchpad.net/bzr/+filebug\n\n")
 
252
 
251
253
        return bzr_log_file
 
254
 
252
255
    except IOError, e:
253
256
        # If we are failing to open the log, then most likely logging has not
254
257
        # been set up yet. So we just write to stderr rather than using