def get_log_formats(config):
 log_format = (((Literal('log_format') + parameter) + Group(OneOrMore(parameter))) + semicolon)
 log_format.ignore(pythonStyleComment)
 for directive in log_format.searchString(config).asList():
  name = directive[1]
  format_string = ''.join(directive[2])
  (yield (name, format_string))

def get_log_formats ( config ) : log_format = ( ( ( Literal ( 'log_format' ) + parameter ) + Group ( OneOrMore ( parameter ) ) ) + semicolon ) log_format . ignore ( pythonStyleComment ) for directive in log_format . searchString ( config ) . asList ( ) : name = directive [ 1 ] format_string = '' . join ( directive [ 2 ] ) ( yield ( name , format_string ) )
parse config for log_format directives :return: iterator over tuple of found directives .