~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Martin Pool
  • Date: 2005-09-30 00:58:02 UTC
  • mto: (1185.14.2)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: mbp@sourcefrog.net-20050930005802-721cfc318e393817
- copy_branch creates destination if it doesn't exist

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        if record.levelno >= logging.WARNING:
59
59
            s += record.levelname + ': '
60
60
            
61
 
        s += record.getMessage() 
 
61
        s += record.getMessage()
 
62
 
 
63
        ##import textwrap
 
64
        ##s = textwrap.fill(s)
62
65
            
63
66
        if record.exc_info:
64
67
            # give just a summary of the exception, not the whole thing
101
104
            return
102
105
        old_fname = trace_fname + '.old'
103
106
 
104
 
        try:
105
 
            # must remove before rename on windows
106
 
            os.remove(old_fname)
107
 
        except OSError:
108
 
            pass
 
107
        from osutils import rename
 
108
        rename(trace_fname, old_fname)
109
109
 
110
 
        try:
111
 
            # might fail if in use on windows
112
 
            os.rename(trace_fname, old_fname)
113
 
        except OSError:
114
 
            pass
115
110
    except OSError:
116
111
        return
117
112
 
197
192
    logging.getLogger('').addHandler(_stderr_handler)
198
193
 
199
194
 
200
 
 
201
195
def disable_default_logging():
202
196
    """Turn off default log handlers.
203
197