#NEWLINE# def log( operation , component = None , source_location = None , content_hash = None , foreign_id = None , source_id = None , document_id = None , meta = None , error_type = None , error_message = None , error_details = None ) : #NEWLINE# #INDENT# 'Record an event taking place during document processing.' #NEWLINE# assert ( operation in ( CRAWL , INGEST , ANALYZE , INDEX ) ) #NEWLINE# if hasattr ( meta , 'to_dict' ) : #NEWLINE# #INDENT# meta = meta . to_dict ( ) #NEWLINE# #UNINDENT# ProcessingLog . log ( operation , component = component , source_location = source_location , content_hash = content_hash , foreign_id = foreign_id , source_id = source_id , document_id = document_id , meta = meta , error_type = error_type , error_message = error_message , error_details = error_details )