<commit_before>// Logger.cpp

#include "Logger.h"
#include <stdarg.h>
#include <time.h>
#include <iostream>

/// Default constructor: called the first time Instance() is called.
/// Open the output file.
Logger::Logger()
{
    m_stream.open("RiftVolume-log.txt");
    Write("RiftVolume log");
}

/// Flush and close the output file.
Logger::~Logger()
{
    m_stream.close();
}

/// Write a message to the log's output stream.
///@param format The string to write to the log.
void Logger::Write(const char* format, ...)
{
    const unsigned int bufSz = 1024;
    char buffer[bufSz];

    va_list args;
    va_start(args, format);
    vsnprintf(buffer, bufSz, format, args);
    va_end(args);
<commit_msg>Use PROJECT_NAME macro in Logger.<commit_after>// Logger.cpp

#include "Logger.h"
#include <stdarg.h>
#include <time.h>
#include <iostream>

#ifndef PROJECT_NAME
// This macro should be defined in CMakeLists.txt
#define PROJECT_NAME "RiftSkeleton"
#endif

/// Default constructor: called the first time Instance() is called.
/// Open the output file.
Logger::Logger()
{
    m_stream.open(PROJECT_NAME "-log.txt");
    Write(PROJECT_NAME "log");
}

/// Flush and close the output file.
Logger::~Logger()
{
    m_stream.close();
}

/// Write a message to the log's output stream.
///@param format The string to write to the log.
void Logger::Write(const char* format, ...)
{
    const unsigned int bufSz = 1024;
    char buffer[bufSz];

    va_list args;
    va_start(args, format);
    vsnprintf(buffer, bufSz, format, args);
    va_end(args);

{'fraction_non_alphanumeric': 0.14165588615782665, 'fraction_numerical': 0.00517464424320828, 'mean_word_length': 3.5634218289085546, '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': '2599156', 'n_tokens_mistral': 526, 'n_tokens_neox': 507, 'n_words': 162}