def format(self, record):
if isinstance(self.fmt, dict):<EOL><INDENT>self._fmt = self.fmt[record.levelname]<EOL>if sys.version_info > (<NUM_LIT:3>, <NUM_LIT:2>):<EOL><INDENT>if self.style not in logging._STYLES:<EOL><INDENT>raise ValueError('<STR_LIT>' % '<STR_LIT:U+002C>'.join(<EOL>list(logging._STYLES.keys())))<EOL><DEDENT>self._style = logging._STYLES[self.style][<NUM_LIT:0>](self._fmt)<EOL><DEDENT><DEDENT>if sys.version_info > (<NUM_LIT:2>, <NUM_LIT:7>):<EOL><INDENT>message = super(LevelFormatter, self).format(record)<EOL><DEDENT>else:<EOL><INDENT>message = ColoredFormatter.format(self, record)<EOL><DEDENT>return message<EOL>
Customize the message format based on the log level.