(self, record)
Emit a record
Emit a record
Emit a record
def emit(self, record):
        """Emit a record"""
        try:
            stream = self.get_wsgierrors()
        except TypeError:
            pass
        else:
            if not stream:
                return
            try:
                msg = self.format(record)
                fs = "%s\n"
                if not hasattr(types, "UnicodeType"):  # if no unicode support
                    stream.write(fs % msg)
                else:
                    try:
                        stream.write(fs % msg)
                    except UnicodeError:
                        stream.write(fs % msg.encode("UTF-8"))
                self.flush()
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                self.handleError(record)
def emit ( self , record ) : try : stream = self . get_wsgierrors ( ) except TypeError : pass else : if not stream : return try : msg = self . format ( record ) fs = "%s\n" if not hasattr ( types , "UnicodeType" ) : # if no unicode support stream . write ( fs % msg ) else : try : stream . write ( fs % msg ) except UnicodeError : stream . write ( fs % msg . encode ( "UTF-8" ) ) self . flush ( ) except ( KeyboardInterrupt , SystemExit ) : raise except : self . handleError ( record )