def emit(self, record):
try:<EOL><INDENT>message = self.format(record)<EOL>if not self.is_colorized:<EOL><INDENT>self.stream.write(message)<EOL><DEDENT>else:<EOL><INDENT>style = self._get_style_function_for_level(record.levelno)<EOL>self.stream.write(style(message))<EOL><DEDENT>self.stream.write(getattr(self, '<STR_LIT>', '<STR_LIT:\n>'))<EOL>self.flush()<EOL><DEDENT>except (KeyboardInterrupt, SystemExit):<EOL><INDENT>raise<EOL><DEDENT>except:<EOL><INDENT>self.handleError(record)<EOL><DEDENT>
Emit a record.

        If the stream associated with this handler provides tty then the record
        that is emitted with be formatted to include escape sequences for
        appropriate styling.