246
246
# Do this before we open the log file, so we prevent
247
247
# get_terminal_encoding() from mutter()ing multiple times
248
248
term_encoding = osutils.get_terminal_encoding()
249
251
# create encoded wrapper around stderr
250
252
bzr_log_file = _open_bzr_log()
251
254
push_log_file(bzr_log_file,
252
255
r'[%(process)5d] %(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
255
257
# after hooking output into bzr_log, we also need to attach a stderr
256
258
# handler, writing only at level info and with encoding
257
259
writer_factory = codecs.getwriter(term_encoding)