~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-22 01:17:00 UTC
  • Revision ID: mbp@sourcefrog.net-20050322011700-4afb362df107c642
put little explanation at top of bzr.log

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
__author__ = "Martin Pool <mbp@canonical.com>"
21
21
 
22
22
 
23
 
import sys, os, time, socket
 
23
import sys, os, time, socket, stat
24
24
import bzrlib
25
25
 
26
26
######################################################################
77
77
    _starttime = os.times()[4]
78
78
 
79
79
    _tracefile = file('.bzr.log', 'at')
80
 
 
81
80
    t = _tracefile
 
81
 
 
82
    if os.fstat(t.fileno())[stat.ST_SIZE] == 0:
 
83
        t.write("\nthis is a debug log for diagnosing/reporting problems in bzr\n")
 
84
        t.write("you can delete or truncate this file, or include sections in\n")
 
85
        t.write("bug reports to bazaar-ng@lists.canonical.com\n\n")
 
86
 
 
87
    # TODO: If we failed to create the file, perhaps give a warning
 
88
    # but don't abort; send things to /dev/null instead?
 
89
 
82
90
    
83
91
    t.write('-' * 60 + '\n')
84
92
    t.write('bzr invoked at %s\n' % bzrlib.osutils.format_date(time.time()))