<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def formatter(self):
 """ Creates and returns a Formatter capable of nicely formatting Lambda function logs Returns ------- LogsFormatter """

        formatter_chain = [
            LambdaLogMsgFormatters.colorize_errors,

            # Format JSON "before" highlighting the keywords. Otherwise, JSON will be invalid from all the
            # ANSI color codes and fail to pretty print
            JSONMsgFormatter.format_json,

            KeywordHighlighter(self._filter_pattern).highlight_keywords,
        ]

        return LogsFormatter(self.colored, formatter_chain)