<commit_before>function beautify() {
	var outputContainer = $("#output-container");
	outputContainer.text("");

	var inputLog = $("#pasted-log").val().split("\n");

	inputLog.forEach(function(entry) {
		outputContainer.append(parseLine(entry));
	});
}

function parseLine(line) {
	var cssClass;

	switch(line.charAt(0)) {
		case "I":
			cssClass = "info-log";
		break;
		case "D":
			cssClass = "debug-log";
		break;
		case "W":
			cssClass = "warning-log";
		break;
		case "E":
			cssClass = "error-log";
		break;
		default:
			cssClass = "verbose-log";
		break;
	}
	return "<ul class=" + cssClass + ">" + line + "</ul>";
}<commit_msg>Added colouring for logs with timestamp and PID/package<commit_after>function beautify() {
	var outputContainer = $("#output-container");
	outputContainer.text("");

	var inputLog = $("#pasted-log").val().split("\n");

	inputLog.forEach(function(entry) {
		outputContainer.append(parseLine(entry));
	});
}

function parseLine(line) {
	var cssClass;
	var useRegex = false;

	cssClass = getClassFromFirstChar(line);

	if(cssClass == "") {
		cssClass = getClassFromRegex(line);
	}

	return "<ul class=\"" + cssClass + "\">" + line + "</ul>";
}

function getClassFromFirstChar(line) {
	switch(line.charAt(0)) {
		case "V":
			return "verbose-log";
		case "I":
			return "info-log";
		case "D":
			return "debug-log";
		case "W":
			return "warning-log";
		case "E":
			return "error-log";
		default:
			return "";
	}
}

function getClassFromRegex(line) {
	switch(line.charAt(line.search(/ [VIDWE]\//)+1)) {
		case "I":
			return "info-log";
		case "D":
			return "debug-log";
		case "W":
			return "warning-log";
		case "E":
			return "error-log";
		default:
			return "verbose-log";
	}
}
{'fraction_non_alphanumeric': 0.19127906976744186, 'fraction_numerical': 0.0017441860465116279, 'mean_word_length': 3.861581920903955, 'pattern_counts': {'":': 13, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7505599', 'n_tokens_mistral': 677, 'n_tokens_neox': 613, 'n_words': 130}