/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: John Arbash Meinel
  • Date: 2008-11-01 14:44:47 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3827.
  • Revision ID: john@arbash-meinel.com-20081101144447-vbmq05112a8lewcn
Handle when _open_bzr_log returns None.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
    # TODO: What should happen if we fail to open the trace file?  Maybe the
231
231
    # objects should be pointed at /dev/null or the equivalent?  Currently
232
232
    # returns None which will cause failures later.
 
233
    return None
233
234
 
234
235
 
235
236
def enable_default_logging():
250
251
                                           timezone='local')
251
252
    # create encoded wrapper around stderr
252
253
    bzr_log_file = _open_bzr_log()
253
 
    bzr_log_file.write(start_time.encode('utf-8') + '\n')
 
254
    if bzr_log_file is not None:
 
255
        bzr_log_file.write(start_time.encode('utf-8') + '\n')
254
256
    push_log_file(bzr_log_file,
255
257
        r'[%(process)5d] %(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
256
258
        r'%Y-%m-%d %H:%M:%S')