
#include "log.h"



CLOG g_log;


bool CLOG::bInit(void)	
{
	p_pFile= fopen("mos3dlog.htm", "wb");
	if(p_pFile==NULL)
		return false;

	fclose(p_pFile);
	return true;
}


bool CLOG::
	bShutdown(void)
{
	if(p_pFile)
		fclose(p_pFile);

	return true;
}


bool CLOG::bPrint(char* a_szText, ...)
{
	va_list l_va;

	//Initialize variable argument list
	va_start(l_va, a_szText);
		//Open the log file for append
		if((p_pFile= fopen("mos3dlog.htm", "a+"))==NULL)
			return false;


		//Write the text and a newline
		vfprintf(p_pFile, a_szText, l_va);
		putc('\n', p_pFile);
	
		//Close the file
		fclose(p_pFile);
	va_end(l_va);
	return true;
}