#NEWLINE# def emit( self , record ) : #NEWLINE# #INDENT# '\n        Store record into the db.\n        ' #NEWLINE# information = get_request_information ( ) #NEWLINE# result = record . msg #NEWLINE# if ( type ( result ) == dict ) : #NEWLINE# #INDENT# information . update ( { #NEWLINE# #INDENT# 'event' : result [ 'name' ] , #NEWLINE# 'time' : datetime . now ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# information [ 'pass' ] = True #NEWLINE# information [ 'action' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( 'exception' in action_parser ) : #NEWLINE# #INDENT# information [ 'action' ] [ 'exception' ] = result [ 'exception' ] #NEWLINE# information [ 'pass' ] = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( result [ 'name' ] in self . action_parsers ) : #NEWLINE# #INDENT# action_parser = self . action_parsers [ result [ 'name' ] ] #NEWLINE# result [ 'kwargs' ] [ 'result' ] = result [ 'result' ] #NEWLINE# action_result = action_parser ( * result [ 'args' ] , ** result [ 'kwargs' ] ) #NEWLINE# information [ 'action' ] . update ( action_result ) #NEWLINE# #UNINDENT# #UNINDENT# api . common . get_conn ( ) . statistics . insert ( information )