Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C++
void Ccustom::log(CString val)
ofstream ofstream_object;
		ofstream_object.open(ApplicationPath, std::ios_base::app);
		Instance=(Ccustom*)pObject;
		CStringA stime(currentTime());
		logtime=stime.AllocSysString();		
		logmsg=val.AllocSysString();
		Instance->Fire_Log(logtime,logmsg);
		SysFreeString(logtime);
		SysFreeString(logmsg);		
		CString logInfo;
		logInfo.Format("%s  :   %s",stime,val);	
		ofstream_object<<logInfo <<'\n';	
		ofstream_object.close();	
		val.Empty();
		logInfo.Empty();
		stime.Empty();
Posted
Updated 20-Jun-14 2:33am
v4
Comments
[no name] 20-Jun-14 7:48am    
Very nice code dump. At least you formatted it, thank you. Did you maybe have some sort of a question or description of some sort of a problem related to this code?
Member 10718181 20-Jun-14 7:52am    
How do I create a day wise log file in Visual C++
Richard MacCutchan 20-Jun-14 8:47am    
What exactly is "a day wise log file"?
Member 10718181 20-Jun-14 9:04am    
log file generate this format every day time 00.00 started a log
20130304.log
20130305.log
20130306.log
20130307.log
20130308.log
Richard MacCutchan 20-Jun-14 9:36am    
So what is your problem?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900