#include "epm_handler_common.h"

#define MAX_PATH_LENGTH 200
#define MAX_PRINTLINE_LENGTH 400000
void WriteLog(logical debug, const char* format, ...)
{
	va_list arg;
	char tmp[MAX_PRINTLINE_LENGTH];
	char date_string[MAX_PATH_LENGTH];
	time_t now;
	struct tm *p;

	//get the message
	memset(tmp, 0, sizeof(tmp));
	va_start(arg, format);
	vsprintf(tmp, format, arg);
	va_end(arg);
	//----------print to command window for trace--------//
	//printf("%s\n", tmp);
	printf("%s\n", tmp);
	//print message to log file
	TC_write_syslog("%s\n", tmp);
}