<commit_before>#pragma once

#include <stdio.h>
#include <time.h>

#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)

#define SIMPLELOGGER_FATAL(target,msg)	(target).fatal( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_ERROR(target,msg)	(target).error( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_INFO(target,msg)	(target).info ( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_DEBUG(target,msg)	(target).debug( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_TRACE(target,msg)	(target).trace( msg, __WFILE__, __LINE__ )

/**
 * Oo̓NX
 */
class CSimpleLogger
{
public:
	/// JeS萔
	enum CATEGORY {
		CATEGORY_FATAL = 0,		///< FATAL
		CATEGORY_ERROR = 1,		///< ERROR
		CATEGORY_INFO  = 2,		///< INFO
		CATEGORY_DEBUG = 3,		///< DEBUG
		CATEGORY_TRACE = 4		///< TRACE
	};

private:
	CString		m_strLogfilePath;	///< Ot@C̃pX
	FILE*		m_fp;				///< FILE
	CATEGORY	m_level;			///< Ox
<commit_msg>エラー発生時にログを出力するように修正<commit_after>#pragma once

#include <stdio.h>
#include <time.h>

#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)

#define SIMPLELOGGER_FATAL(target,msg)	(target).fatal( msg, __WFILE__, __LINE__ ); (target).flush()
#define SIMPLELOGGER_ERROR(target,msg)	(target).error( msg, __WFILE__, __LINE__ ); (target).flush()
#define SIMPLELOGGER_INFO(target,msg)	(target).info ( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_DEBUG(target,msg)	(target).debug( msg, __WFILE__, __LINE__ )
#define SIMPLELOGGER_TRACE(target,msg)	(target).trace( msg, __WFILE__, __LINE__ )

/**
 * Oo̓NX
 */
class CSimpleLogger
{
public:
	/// JeS萔
	enum CATEGORY {
		CATEGORY_FATAL = 0,		///< FATAL
		CATEGORY_ERROR = 1,		///< ERROR
		CATEGORY_INFO  = 2,		///< INFO
		CATEGORY_DEBUG = 3,		///< DEBUG
		CATEGORY_TRACE = 4		///< TRACE
	};

private:
	CString		m_strLogfilePath;	///< Ot@C̃pX
	FILE*		m_fp;				///< FILE
	CATEGORY	m_level;			///< Ox

{'fraction_non_alphanumeric': 0.1568421052631579, 'fraction_numerical': 0.007368421052631579, 'mean_word_length': 4.295264623955432, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, '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': '4296107', 'n_tokens_mistral': 887, 'n_tokens_neox': 855, 'n_words': 158}