def METHOD_NAME(logFileLines, allruns):
	# every start marker indicates a new run, we usually print only the last such run,
	# unless allruns is set to true
	header_printed = False
	current_run_number = 0
	current_run_name = ""
	current_output = []
	for line in logFileLines:
		utf8_line = line.decode('utf-8')
		start_marker_match = re.search(r'CDebugCounterEventLoggingStart', utf8_line)
		counter_log_match = re.search(r'CDebugCounterEvent\(', utf8_line)
		eof_match = re.match(r'EOF', utf8_line)
		if start_marker_match or eof_match:
			if len(current_run_name) > 0:
				# we are at the end of a run (and possibly the beginning of a new one)
				# if allruns is True then print this run, otherwise print it only when we are at EOF
				if allruns or eof_match:
					if not header_printed:
						# print this header only once
						print_or_insert_header_row("run, query num, query name, counter name, counter_type, counter_value")
						header_printed = True
					# print a dummy counter line that indicates the starting time of the run
					print_or_insert_row("%d, 0, , %s, run_start_time, 0" % (current_run_number, current_run_name))
					# now print the actual counter values
					for l in current_output:
						print_or_insert_row(l)
			# prepare for the next run by cleaning out our output list, this happens whether
			# we printed the previous run or whether we ignored it
			current_output = []
			if (not allruns):
				# we are only interested in the last run, discard
				# all information about previous runs
				current_run_number = 0
			# assign a number and a name to a run that may be following
			current_run_number += 1
			# the run name is the starting timestamp
			current_run_name = re.sub(r'.*:([0-9]+-[^,]+),.*\n',
									  r'\1',
									  utf8_line)
		elif counter_log_match:
			# we encountered the log entry for one event, remove prefix and suffix and
			# extract the comma-separated values in-between
			csv = re.sub(r'.*CDebugCounterEvent\(.*\)\s*,\s*([^"]+).*\n',
						 r'\1',
						 utf8_line)
			# prepend the run number to the comma-separated values
			csv = "%d, %s" % (current_run_number, csv)
			current_output.append(csv)