<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def define_log_renderer(fmt, fpath, quiet):
 """ the final log processor that structlog requires to render. """

    # it must accept a logger, method_name and event_dict (just like processors)
    # but must return the rendered string, not a dictionary.
    # TODO tty logic

    if fmt:
        return structlog.processors.JSONRenderer()

    if fpath is not None:
        return structlog.processors.JSONRenderer()

    if sys.stderr.isatty() and not quiet:
        return structlog.dev.ConsoleRenderer()

    return structlog.processors.JSONRenderer()