#NEWLINE# def emit( self , record ) : #NEWLINE# #INDENT# stream = self . stream #NEWLINE# try : #NEWLINE# #INDENT# if ( hasattr ( sys , 'called_from_test' ) and sys . called_from_test ) : #NEWLINE# #INDENT# msg = self . format ( record , True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = self . format ( record , stream . isatty ( ) ) #NEWLINE# #UNINDENT# stream . write ( msg ) #NEWLINE# stream . write ( self . terminator ) #NEWLINE# self . flush ( ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# self . handleError ( record )