#NEWLINE# def emit( self , record ) : #NEWLINE# #INDENT# '\n        Send a LogRecord object formatted as json_event via a\n        queue and worker thread.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# if ( self . sock is None ) : #NEWLINE# #INDENT# self . connect ( ) #NEWLINE# #UNINDENT# jsonrecord = self . jsonify ( record ) #NEWLINE# jsonrecord = ( '%s\n' % jsonrecord ) #NEWLINE# self . sock . sendall ( jsonrecord ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# INTERNAL_LOG . exception ( 'Error sending message to log server' ) #NEWLINE# self . close ( )