<commit_before>#include "Application.hpp"

#include "Logger.hpp"

void glfw_error_callback(int, const char* description) {
	g_logger.write(Logger::LogLevel::LOG_ERROR, description);
}

int main(int argc, char* argv[]) {
	g_logger.write(Logger::LogLevel::LOG_INFO, "Starting program");

	glfwSetErrorCallback(glfw_error_callback);
	if(!glfwInit()) { throw std::runtime_error("GLFW initialization failed"); }

	try {
		const char* plArgv[] = {argv[0], "--quiet"};
		g_logger.write(Logger::LogLevel::LOG_INFO, "Starting Prolog engine");
		PlEngine engine(2, const_cast<char**>(plArgv));

		Application app(argc, argv);
		app.run();
	} catch(const std::exception& exception) {
		g_logger.write(Logger::LogLevel::LOG_CRITICAL, exception.what());
		g_logger.write(Logger::LogLevel::LOG_INFO, "Exited program unsuccessfully");
		return EXIT_FAILURE;
	}

	glfwTerminate();
	g_logger.write(Logger::LogLevel::LOG_INFO, "Exited program successfully");
	return EXIT_SUCCESS;
}
<commit_msg>Don't throw from top level<commit_after>#include "Application.hpp"

#include "Logger.hpp"

void glfw_error_callback(int, const char* description) {
	g_logger.write(Logger::LogLevel::LOG_ERROR, description);
}

int main(int argc, char* argv[]) {
	g_logger.write(Logger::LogLevel::LOG_INFO, "Starting program");

	glfwSetErrorCallback(glfw_error_callback);
	if(!glfwInit()) {
		g_logger.write(Logger::LogLevel::LOG_CRITICAL,
		               "GLFW initialization failed");
		return EXIT_FAILURE;
	}

	try {
		const char* plArgv[] = {argv[0], "--quiet"};
		g_logger.write(Logger::LogLevel::LOG_INFO, "Starting Prolog engine");
		PlEngine engine(2, const_cast<char**>(plArgv));

		Application app(argc, argv);
		app.run();
	} catch(const std::exception& exception) {
		g_logger.write(Logger::LogLevel::LOG_CRITICAL, exception.what());
		g_logger.write(Logger::LogLevel::LOG_INFO, "Exited program unsuccessfully");
		return EXIT_FAILURE;
	}

	glfwTerminate();
	g_logger.write(Logger::LogLevel::LOG_INFO, "Exited program successfully");
	return EXIT_SUCCESS;
}

{'fraction_non_alphanumeric': 0.15354330708661418, 'fraction_numerical': 0.001968503937007874, 'mean_word_length': 6.759541984732825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4172998', 'n_tokens_mistral': 720, 'n_tokens_neox': 685, 'n_words': 126}