#NEWLINE# @ staticmethod #NEWLINE# def create_line_matchers( log_config , max_line_length , line_completion_wait_time ) : #NEWLINE# #INDENT# 'Creates line matchers based on the config passed in\n        see: https://www.scalyr.com/help/parsing-logs#multiline for more info\n\n        If no lineGroupers attribute is found, then it defaults to a single line matcher\n\n        @param log_config: A JsonObject containing the log config\n        @param max_line_length: The maximum amount to read before returning a new line\n        @param line_completion_wait_time: The maximum amount of time to wait\n            if only a partial line is ready\n        @return - a line matcher object based on the config\n        ' #NEWLINE# line_groupers = log_config [ 'lineGroupers' ] #NEWLINE# if ( not line_groupers ) : #NEWLINE# #INDENT# return LineMatcher ( max_line_length , line_completion_wait_time ) #NEWLINE# #UNINDENT# result = LineMatcherCollection ( max_line_length , line_completion_wait_time ) #NEWLINE# for grouper in line_groupers : #NEWLINE# #INDENT# if ( 'start' in grouper ) : #NEWLINE# #INDENT# if ( 'continueThrough' in grouper ) : #NEWLINE# #INDENT# matcher = ContinueThrough ( grouper [ 'start' ] , grouper [ 'continueThrough' ] , max_line_length , line_completion_wait_time ) #NEWLINE# result . add_matcher ( matcher ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'continuePast' in grouper ) : #NEWLINE# #INDENT# matcher = ContinuePast ( grouper [ 'start' ] , grouper [ 'continuePast' ] , max_line_length , line_completion_wait_time ) #NEWLINE# result . add_matcher ( matcher ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'haltBefore' in grouper ) : #NEWLINE# #INDENT# matcher = HaltBefore ( grouper [ 'start' ] , grouper [ 'haltBefore' ] , max_line_length , line_completion_wait_time ) #NEWLINE# result . add_matcher ( matcher ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'haltWith' in log_config ) : #NEWLINE# #INDENT# matcher = HaltWith ( grouper [ 'start' ] , grouper [ 'haltWith' ] , max_line_length , line_completion_wait_time ) #NEWLINE# result . add_matcher ( matcher ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'Error, no continuation pattern found for line grouper: %s' % str ( grouper ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'Error, no start pattern found for line grouper: %s' % str ( grouper ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return result