def _get_plain_formatter(self, logformat: type_logformat, dateformat: Optional[str]) -> logging.Formatter:
        """Returns a logging formatter with the specified format and date format.

        .. note::
            If the log format isn't a string, prints a warning message and uses the default log format instead.

        :param logformat: The format of the log messages.
        :param dateformat: The format of the timestamp in the log messages.

        :returns: A logging formatter object that can be used to format log records.
        """

        if not isinstance(logformat, str):
            _LOGGER.warning('Expected log format to be a string when log type is plain, but got "%s"', _type(logformat))
            logformat = PatroniLogger.DEFAULT_FORMAT

        return logging.Formatter(logformat, dateformat)
Returns a logging formatter with the specified format and date format.

        .. note::
            If the log format isn't a string, prints a warning message and uses the default log format instead.

        :param logformat: The format of the log messages.
        :param dateformat: The format of the timestamp in the log messages.

        :returns: A logging formatter object that can be used to format log records.
        
patroni/log.py