Hello,
I'm working on, to write the debug statements to logfile or console depends on working environment.
What I have did:
this cause cout to redirect the output to log and it's working fine.
The situation is, I like to include the date/time, in front of each message.
e.g cout<<"Hello"<< endl;
will log -
[10/10/2010 12:24:32] Hello
Hope I'm clear in my question.
Many Thanks
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);
The situation is, I like to include the date/time, in front of each message.
e.g cout<<"Hello"<< endl;
will log -
[10/10/2010 12:24:32] Hello
Hope I'm clear in my question.
Many Thanks
Comment