#NEWLINE# def Log( self , format_str , * args ) : #NEWLINE# #INDENT# "Logs the message using the flow's standard logging.\n\n    Args:\n      format_str: Format string\n      *args: arguments to the format string\n    Raises:\n      RuntimeError: on parent missing logs_collection\n    " #NEWLINE# format_str = utils . SmartUnicode ( format_str ) #NEWLINE# try : #NEWLINE# #INDENT# status = ( format_str % args ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# logging . error ( 'Tried to log a format string with the wrong number of arguments: %s' , format_str ) #NEWLINE# status = format_str #NEWLINE# #UNINDENT# logging . info ( '%s: %s' , self . session_id , status ) #NEWLINE# self . SetStatus ( utils . SmartUnicode ( status ) ) #NEWLINE# logs_collection = self . OpenLogsCollection ( self . args . logs_collection_urn ) #NEWLINE# logs_collection . Add ( rdf_flows . FlowLog ( client_id = None , urn = args . session_id , flow_name = self . flow_obj . __class__ . __name__ , log_message = status ) ) #NEWLINE# logs_collection . Flush ( )