<commit_before>/**
 * Copyright (C) <NAME>
 */
#include <stdarg.h>
#include <stdio.h>
#include "log.h"


static const char *error_levels[] = {
    NULL,
    "error",
    "info",
    "debug"
};


void ch_log_write(unsigned int level, const char *fmt, ...)
{
    int written;
    char log_buffer[8192];
    char *p;
    va_list vargs;

    written = snprintf(log_buffer, sizeof(log_buffer), "chimp: [%s] ", error_levels[level]);
    p = log_buffer + written;
    va_start(vargs, fmt);
    written = vsnprintf(p, sizeof(log_buffer) - written, fmt, vargs);
    va_end(vargs);
    p += written;
    *p = '\n';

    fprintf(stdout, "%s", log_buffer);
}<commit_msg>fix logging<commit_after>/**
 * Copyright (C) <NAME>
 */
#include <stdarg.h>
#include <stdio.h>
#include "log.h"


static const char *error_levels[] = {
    NULL,
    "error",
    "info",
    "debug"
};


void ch_log_write(unsigned int level, const char *fmt, ...)
{
    int written;
    char log_buffer[8192];
    char *p;
    va_list vargs;

    written = snprintf(log_buffer, sizeof(log_buffer), "chimp: [%s] ", error_levels[level]);
    p = log_buffer + written;
    va_start(vargs, fmt);
    written = vsnprintf(p, sizeof(log_buffer) - written, fmt, vargs);
    va_end(vargs);
    p += written;
    *p++ = '\n';
    *p = '\0';

    fprintf(stdout, "%s", log_buffer);
}
{'fraction_non_alphanumeric': 0.17430503380916604, 'fraction_numerical': 0.0067618332081141996, 'mean_word_length': 3.1625, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '849358', 'n_tokens_mistral': 517, 'n_tokens_neox': 497, 'n_words': 119}