Hello,

I'm working on, to write the debug statements to logfile or console depends on working environment.

What I have did:

Code:
	
	streambuf *psbuf;
	ofstream logFile;
	logFile.open(LOGFILE);

	psbuf = logFile.rdbuf();
	cout.rdbuf(psbuf);
this cause cout to redirect the output to log and it's working fine.

The situation is, I like...