def handlerAndBytesIO():
 output = BytesIO()
 stream = output
 template = py_logging.BASIC_FORMAT
 if _PY3:
  stream = TextIOWrapper(output, encoding='utf-8', newline='\n')
 formatter = py_logging.Formatter(template)
 handler = py_logging.StreamHandler(stream)
 handler.setFormatter(formatter)
 return (handler, output)

def handlerAndBytesIO ( ) : output = BytesIO ( ) stream = output template = py_logging . BASIC_FORMAT if _PY3 : stream = TextIOWrapper ( output , encoding = 'utf-8' , newline = '\n' ) formatter = py_logging . Formatter ( template ) handler = py_logging . StreamHandler ( stream ) handler . setFormatter ( formatter ) return ( handler , output )
construct a 2-tuple of c{} for testing interaction with the logging module .