
#include "debuglogger.h"
#include <stdarg.h>

using std::ofstream;
using std::ios;

DebugLogger::DebugLogger() {
}

DebugLogger* DebugLogger::GetInstance() {
	if (m_instance == NULL) {
		m_instance = new DebugLogger();
	}
	return m_instance;
}

void DebugLogger::Log(const char* msg) { 
	std::cout << msg << std::endl; 
}

void DebugLogger::LogToFile(const char* format, ...) {
// is mir zu viel Arbeit das schön zu machen...
	char buffer[500];
	
	va_list vl;
 	va_start(vl,format);
 	sprintf(buffer, format, vl);
	va_end(vl);

	ofstream fp_out;
	fp_out.open("C:\\bot.outfile.txt", ios::out | ios::app);
		
	fp_out << buffer;
	fp_out.close();

}
