def format(self, record):
levelname = record.levelname    <EOL>if levelname == '<STR_LIT>':<EOL><INDENT>levelname = record.levelname = '<STR_LIT>'<EOL><DEDENT>if self.usesTime():<EOL><INDENT>record.asctime = self.formatTime(record, self.datefmt)<EOL><DEDENT>try:  <EOL><INDENT>message = record.getMessage()<EOL><DEDENT>except TypeError:<EOL><INDENT>message = record.msg.format(*record.args)<EOL><DEDENT>if self._highlight:<EOL><INDENT>match = self.data_search(message, <NUM_LIT:0>, DATA_SEARCH_LIMIT)<EOL>if match:<EOL><INDENT>pos = match.start()<EOL>front, back = message[:pos], message[pos:]  <EOL>if front.endswith('<STR_LIT:\n>'):                    <EOL><INDENT>back = pformat(record.args)<EOL>back = left_indent(back, self._code_indent)<EOL><DEDENT>back = self._highlight(back, self._lexer, self._hl_formatter)<EOL>message = f'<STR_LIT>'<EOL><DEDENT><DEDENT>record.message = message<EOL>record.on = self._theme_style.get(levelname, '<STR_LIT>')<EOL>record.icon = self._theme_icons.get(levelname, '<STR_LIT>')<EOL>record.off = _end<EOL>s = self.formatMessage(record)<EOL>if record.exc_info:<EOL><INDENT>if not record.exc_text:<EOL><INDENT>record.exc_text = self.formatException(record.exc_info)<EOL><DEDENT><DEDENT>if record.exc_text:<EOL><INDENT>if s[-<NUM_LIT:1>:] != "<STR_LIT:\n>":<EOL><INDENT>s = s + "<STR_LIT:\n>"<EOL><DEDENT>s = s + record.exc_text<EOL><DEDENT>if record.stack_info:<EOL><INDENT>if s[-<NUM_LIT:1>:] != "<STR_LIT:\n>":<EOL><INDENT>s = s + "<STR_LIT:\n>"<EOL><DEDENT>s = s + self.formatStack(record.stack_info)<EOL><DEDENT>return s<EOL>
Log color formatting.