code: def define_log_renderer(fmt, fpath, quiet):
      
      # 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()
docs: the final log processor that structlog requires to render.