def METHOD_NAME():
    while True:
        _write("READY\n")
        header = _parse_header(sys.stdin.readline())
        payload = sys.stdin.read(int(header["len"]))
        # Only handle PROCESS_LOG_* events and just ACK anything else.
        if header["eventname"] == "PROCESS_LOG_STDOUT":
            _log_payload(payload)
        elif header["eventname"] == "PROCESS_LOG_STDERR":
            _log_payload(payload, err=True)
        _write("RESULT 2\nOK")