Put date/time in logfile header

Discuss possible software enhancements/changes here.

Moderator: Matt

Post Reply
Torque
 

Posts: 639
Joined: Wed Jun 16, 2010 10:08 am

Put date/time in logfile header

Post by Torque »

As per title, would be nice to have this information in the .log

Cheers ..
Attachments
log.jpg
(34.08 KiB) Downloaded 2678 times
CoZZm0
 

Posts: 133
Joined: Fri May 21, 2010 8:07 pm
Location: Sydney, Australia

Re: Put date/time in logfile header

Post by CoZZm0 »

date and time is on the file creation itself, unless you modify and save the file i guess.
Torque
 

Posts: 639
Joined: Wed Jun 16, 2010 10:08 am

Re: Put date/time in logfile header

Post by Torque »

True, but that can be changed/lost etc.
I look at this from Excel, and it would be nice to have it in there (included is already the image name, so date / time would be helpful)
Matt
Site Admin
 

Posts: 8990
Joined: Sun Jan 29, 2006 1:45 am
Location: Adelaide, Australia
Contact:

Re: Put date/time in logfile header

Post by Matt »

// Get date / time into log header for Torque :P
CTime currtime = CTime::GetCurrentTime();

CString timestring;
timestring.Format(_T(" %02d/%02d/%04d::%02d:%02d:%02d"),
currtime.GetMonth(),
currtime.GetDay(),
currtime.GetYear(),
currtime.GetHour(),
currtime.GetMinute(),
currtime.GetSecond());

CString dline = "DESC: " + GetDocument()->m_pAddress->ecu_adr_desc + " : " +
GetDocument()->m_pImageHdlr->imagemgr[curimg].description + timestring + _T("\r\n");

h_consult_log.Write(dline.GetBuffer(0), dline.GetLength());
8)

DESC: HCR32 SKYLINE (RB20DET) : HCR32_RB20DET_04U11_AT_MECR109 03/22/2012::23:42:21
Matt
Site Admin
 

Posts: 8990
Joined: Sun Jan 29, 2006 1:45 am
Location: Adelaide, Australia
Contact:

Re: Put date/time in logfile header

Post by Matt »

Actually why is the month first... rearranging
Torque
 

Posts: 639
Joined: Wed Jun 16, 2010 10:08 am

Re: Put date/time in logfile header

Post by Torque »

Good stuff!
:)
Post Reply