///////////////// Log Class ///////////////////////////
/// This is my log class for IPhysics, its not much
/// but it does the job without a problem.
//////////////////////////////////// IPhysics /////////

#include "CLog.h"

using namespace std; // Visual Studio 2005

CLog::CLog()
{
	//Set the message to be logged to nothing
	m_logMsg = "";
}

/// This function is used to set whether iphysics should log its
//! events, or to print its errors in the console and to set the
//! path of the log file.
void CLog::doLog(bool doLog, bool doEcho, stringc pth)
{
	m_echo = doEcho;
	m_log = doLog;
	m_path = pth;
}

/// This function writes a message to the log file.
void CLog::writeLog(char* msg)
{
	//Add the current log message to the previous log messages
	m_logMsg += msg;

	//create an instance of the out stream and set log.txt to be
	//the output file, then write out all the messages
	if (m_log && m_path != "")
	{
//		ofstream fLogger(m_path.c_str());
//		fLogger << m_logMsg.c_str();
	}

	//Display the message in the console window if you want to
//	if(m_echo == true)
//		cout << "IPhysics: " << msg << endl;
}
