def emit(self, record):
        """
        Emit a record.

        If a formatter is specified, it is used to format the record.
        The record is then written to the stream with a trailing newline.  If
        exception information is present, it is formatted using
        traceback.print_exception and appended to the stream.  If the stream
        has an 'encoding' attribute, it is used to encode the message before
        output to the stream.
        """
        try:
            msg = self.format(record)
            fs = "%s\n"
            if not hasattr(types, "UnicodeType"): #if no unicode support...
                self.stream.write(fs % msg)
            else:
                try:
                    if getattr(self.stream, 'encoding', None) is not None:
                        self.stream.write(fs % msg.encode(self.stream.encoding))
                    else:
                        self.stream.write(fs % msg)
                except UnicodeError:
                    self.stream.write(fs % msg.encode("UTF-8"))
            self.flush()
        except (__HOLE__, SystemExit):
            raise
        except:
            self.handleError(record)
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/logging/__init__.py/StreamHandler.emit