<commit_before>/*
 * PRS - Personal Radio Station
 *
 * Copyright 2003 <NAME>
 *
 */

#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <curl/curl.h>
#include "fileinfo.h"
#include "logger.h"


logger *
logger_new (const LOGGER_TYPE type,
	    const char *log_file_name,
	    const char *url,
	    const char *username,
	    const char *password,
	    const char *mount)
{
	logger *l = malloc (sizeof(logger));

	if (log_file_name) {
		l->log_file = fopen (log_file_name, "w");
		fprintf (l->log_file, "<log>\n");
	}
	else
		l->log_file = NULL;<commit_msg>src/logger.c: Define _GNU_SOURCE and include <stdio.h> for asprintf().<commit_after>/*
 * PRS - Personal Radio Station
 *
 * Copyright 2003 <NAME>
 *
 */

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <curl/curl.h>
#include "fileinfo.h"
#include "logger.h"


logger *
logger_new (const LOGGER_TYPE type,
	    const char *log_file_name,
	    const char *url,
	    const char *username,
	    const char *password,
	    const char *mount)
{
	logger *l = malloc (sizeof(logger));

	if (log_file_name) {
		l->log_file = fopen (log_file_name, "w");
		fprintf (l->log_file, "<log>\n");
	}
	else
		l->log_file = NULL;
{'fraction_non_alphanumeric': 0.15047021943573669, 'fraction_numerical': 0.006269592476489028, 'mean_word_length': 3.6776556776556775, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '3544351', 'n_tokens_mistral': 517, 'n_tokens_neox': 478, 'n_words': 125}