<commit_before>#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/consoleappender.h>
#include <log4cxx/patternlayout.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/spi/loggingevent.h>
#include <log4cxx/level.h>

using namespace log4cxx;
using namespace log4cxx::helpers;
using namespace log4cxx::spi;

int main()
{
	int ret = EXIT_SUCCESS;
	
	try
	{
		PatternLayoutPtr layout = new PatternLayout();
		layout->setConversionPattern(_T("%-5p [%t]: %m%n"));
		LoggingEvent event(
			Logger::getStaticClass().getName(),
			Logger::getRootLogger(),
			Level::getDebugLevel(),
			_T("debug message"),
			"file.cpp", 
			12
			);
		
		StringBuffer result, witness;
		
		witness << _T("DEBUG [") << event.getThreadId()
			<< _T("]: debug message") << std::endl;
//		tcout << witness.str();

		layout->format(result, event);
//		tcout << result.str();
		
		if (witness.str() != result.str())
		{
			ret = EXIT_FAILURE;
		}
	}
	catch(Exception&)
	{
		ret = EXIT_FAILURE;
	}
	
	return ret;
}<commit_msg>error management<commit_after>#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/consoleappender.h>
#include <log4cxx/patternlayout.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/spi/loggingevent.h>
#include <log4cxx/level.h>

using namespace log4cxx;
using namespace log4cxx::helpers;
using namespace log4cxx::spi;

int main()
{
	int ret = EXIT_SUCCESS;
	
	try
	{
		PatternLayoutPtr layout = new PatternLayout();
		layout->setConversionPattern(_T("%-5p [%t]: %m%n"));
		LoggingEvent event(
			Logger::getStaticClass().getName(),
			Logger::getRootLogger(),
			Level::getDebugLevel(),
			_T("debug message"),
			"file.cpp", 
			12
			);
		
		StringBuffer result, witness;

		witness << _T("DEBUG [") << event.getThreadId()
			<< _T("]: debug message") << std::endl;
//		tcout << witness.str();

		layout->format(result, event);
//		tcout << result.str();
		
		if (witness.str() != result.str())
		{
			tcout << witness.str();
			tcout << result.str() << std::endl;
			ret = EXIT_FAILURE;
		}
	}
	catch(Exception&)
	{
		ret = EXIT_FAILURE;
	}
	
	return ret;
}
{'fraction_non_alphanumeric': 0.17482185273159145, 'fraction_numerical': 0.01140142517814727, 'mean_word_length': 4.161764705882353, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 21, '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': '7459974', 'n_tokens_mistral': 867, 'n_tokens_neox': 779, 'n_words': 148}