def METHOD_NAME(log_file, __main__module):
    from robocorp_ls_core.basic import kill_process_and_subprocesses
    from robocorp_ls_core.subprocess_wrapper import subprocess
    language_server_process = subprocess.Popen(
        [
            sys.executable,
            "-u",
            __main__module.__file__,
            "-vv",
            "--log-file=%s" % log_file,
        ],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        stdin=subprocess.PIPE,
    )
    stderr = language_server_process.stderr
    buf = []
    t = threading.Thread(target=_stderr_reader, args=(stderr, buf))
    t.name = "Stderr reader"
    t.start()
    returncode = language_server_process.poll()
    assert returncode is None
    try:
        yield language_server_process
    finally:
        t.join(1)
        stderr_contents = b"".join(buf).decode("utf-8")
        if stderr_contents:
            sys.stderr.write(f"Found stderr contents: >>\n{stderr_contents}\n<<")
        returncode = language_server_process.poll()
        if returncode is None:
            kill_process_and_subprocesses(language_server_process.pid)