#include "log.h"

#include <iostream>
#include <fstream>
#include <string>

#ifndef WIN32
#include <unistd.h>
#endif

std::string Log_dir;

void SetLogDir(const char * dir)
{
	Log_dir = std::string(dir);
	//Log_dir = "";
}

void Message(const char * E, const char * Mess)
{
	std::cout << E << ".message: " << Mess << "\n";
	std::ofstream logfile ( "Log.txt", std::ios::app);
	logfile << E << ".message: " << Mess << "\n";
}

void Error(const char * E, const char * Err)
{
	std::cout << E << ".error: " << Err << "\n";
	std::ofstream logfile ( "Log.txt", std::ios::app);
	logfile << E << ".error: " << Err << "\n";
	//DestroyWindow(main_hWnd);
#ifdef WIN32
	exit(1);
#else
    _exit(1);
#endif
}
