#include <cstdio>
#include <iostream>
#include <fstream>
#include <math.h>

//compiler switches:
#define DEBUG_LOG 1

namespace t3devlib {
namespace gen {

void debug_log(const char* pFile, const char * value)
{
#ifdef DEBUG_LOG
	std::ofstream logfile(pFile, std::ios::app);
	logfile << value << std::endl;
	logfile.close();
#endif
}

void debug_log_PreDecode(const char* pFile, const char * type)
{
#ifdef DEBUG_LOG
	std::ofstream logfile(pFile, std::ios::app);
	logfile << type << "::PreDecode: " << std::endl;
	logfile.close();
#endif
}

void debug_log_PreDecodeField(const char* pFile, const char * type, int id)
{
#ifdef DEBUG_LOG
	std::ofstream logfile(pFile, std::ios::app);
	logfile << type << "::PreDecodeField: " << id << std::endl;
	logfile.close();
#endif
}

void debug_log_PostDecodeField(const char* pFile, const char * type, int id)
{
#ifdef DEBUG_LOG
	std::ofstream logfile(pFile, std::ios::app);
	logfile << type << "::PostDecodeField: " << id << std::endl;
	logfile.close();
#endif
}

}} // namespaces
