231
232
"""Redirect logging to a temporary file for a test
233
234
returns an opaque reference that should be passed to disable_test_log
236
237
disable_default_logging()
238
240
hdlr = logging.StreamHandler(to_file)
239
241
hdlr.setLevel(logging.DEBUG)
240
242
hdlr.setFormatter(logging.Formatter('%(levelname)8s %(message)s'))
241
243
_bzr_logger.addHandler(hdlr)
242
244
_bzr_logger.setLevel(logging.DEBUG)
249
252
_bzr_logger.removeHandler(test_log_hdlr)
251
256
_trace_file = old_trace_file
255
262
def format_exception_short(exc_info):