@contextlib.contextmanager<EOL>def streaming_to_client():
for handler in client_logger.handlers:<EOL><INDENT>if hasattr(handler, '<STR_LIT>'):<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>handler = None<EOL><DEDENT>old_propagate = client_logger.propagate<EOL>client_logger.propagate = False<EOL>if handler is not None:<EOL><INDENT>old_append = handler.append_newlines<EOL>handler.append_newlines = False<EOL><DEDENT>yield<EOL>client_logger.propagate = old_propagate<EOL>if handler is not None:<EOL><INDENT>handler.append_newlines = old_append<EOL><DEDENT>
Puts the client logger into streaming mode, which sends
    unbuffered input through to the socket one character at a time.
    We also disable propagation so the root logger does not
    receive many one-byte emissions. This context handler
    was originally created for streaming Compose up's
    terminal output through to the client and should only be
    used for similarly complex circumstances.