<commit_before>//
//  Log.hpp
//  MusicPlayer
//
//  Created by <NAME> on 07.01.14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#ifndef MusicPlayer_Log_hpp
#define MusicPlayer_Log_hpp

#include <iostream>
#include <sstream>
#include <string>
#include <time.h>
#include <sys/time.h>

struct Log {
	std::string name;
	bool needNewPrefix;

	Log(const std::string& _name) : name(_name) { resetPrefix(); }

	void resetPrefix() {
		needNewPrefix = true;
	}

	void printPrefix() {
		struct timeval t;
		gettimeofday(&t, NULL);
		struct tm* now = gmtime( &t.tv_sec );
		char timestamp[256];
		strftime(timestamp, sizeof(timestamp), "%Y-%m-%d_%H.%M.%S", now);
		int millisecs = (t.tv_usec / 1000) % 1000;
		char ms_str[5];
		sprintf(ms_str, "%.03d", millisecs);
		(*this) << "[" << name.c_str() << ":" << timestamp << "." << ms_str << "] ";
	}<commit_msg>small fix<commit_after>//
//  Log.hpp
//  MusicPlayer
//
//  Created by <NAME> on 07.01.14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#ifndef MusicPlayer_Log_hpp
#define MusicPlayer_Log_hpp

#include <iostream>
#include <sstream>
#include <string>
#include <time.h>
#include <sys/time.h>

struct Log {
	std::string name;
	bool needNewPrefix;

	Log(const std::string& _name) : name(_name) { resetPrefix(); }

	void resetPrefix() {
		needNewPrefix = true;
	}

	void printPrefix() {
		struct timeval t;
		gettimeofday(&t, NULL);
		struct tm* now = gmtime( &t.tv_sec );
		char timestamp[256];
		strftime(timestamp, sizeof(timestamp), "%Y-%m-%d_%H.%M.%S", now);
		int millisecs = (t.tv_usec / 1000) % 1000;
		char ms_str[5];
		sprintf(ms_str, "%.03d", millisecs);
		std::cout << "[" << name.c_str() << ":" << timestamp << "." << ms_str << "] ";
	}
{'fraction_non_alphanumeric': 0.19194865810968495, 'fraction_numerical': 0.028004667444574097, 'mean_word_length': 3.817415730337079, 'pattern_counts': {'":': 2, '<': 45, '<?xml version=': 0, '>': 17, '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': '6750452', 'n_tokens_mistral': 732, 'n_tokens_neox': 658, 'n_words': 153}