<commit_before>#include "logger.h"

void logger(int type, char *s1, char *s2) {
	int fd;
	char logbuffer[BUFSIZE*2];

	switch(type) {
		case LOG:
			sprintf(logbuffer, "LOG: %s : %s", s1, s2);
			break;
		case ERROR:
			sprintf(logbuffer, "500 INTERNAL SERVER ERROR: %s : %s", s1, s2);
			break;
		case NOTFOUND:
			sprintf(logbuffer, "404 NOTFOUND: %s : %s", s1, s2);
			break;
		case FORBIDDEN:
			sprintf(logbuffer, "403 FORBIDDEN: %s : %s", s1, s2);
			break;
	}

	if ((fd = open("nweb.log", O_CREAT | O_WRONLY | O_APPEND, 0644)) >= 0) {
		write(fd, logbuffer, strlen(logbuffer));
		write(fd, "\n", 1);
		close(fd);
	}
}<commit_msg>proper log file<commit_after>#include "logger.h"

void logger(int type, char *s1, char *s2) {
	int fd;
	char logbuffer[BUFSIZE*2];

	switch(type) {
		case LOG:
			sprintf(logbuffer, "LOG: %s : %s", s1, s2);
			break;
		case ERROR:
			sprintf(logbuffer, "500 INTERNAL SERVER ERROR: %s : %s", s1, s2);
			break;
		case NOTFOUND:
			sprintf(logbuffer, "404 NOTFOUND: %s : %s", s1, s2);
			break;
		case FORBIDDEN:
			sprintf(logbuffer, "403 FORBIDDEN: %s : %s", s1, s2);
			break;
	}

	if ((fd = open("grocery.log", O_CREAT | O_WRONLY | O_APPEND, 0644)) >= 0) {
		write(fd, logbuffer, strlen(logbuffer));
		write(fd, "\n", 1);
		close(fd);
	}
}
{'fraction_non_alphanumeric': 0.1816758026624902, 'fraction_numerical': 0.04072043852779953, 'mean_word_length': 3.7509293680297398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5571008', 'n_tokens_mistral': 627, 'n_tokens_neox': 553, 'n_words': 142}