~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

Tags: bzr-1.9
(mbp) prepare 1.9final

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')