Add day/date to log file entries?

Got a good idea? You can suggest new features here.
Post Reply
wysocki
Experienced User
Posts: 55
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Add day/date to log file entries?

Post by wysocki » Tue Oct 04, 2016 4:07 am

I have the Log Redirector and Filter installed and it does what it is supposed to do. However, it'd be great if there was an option to include the date (or at least the day) in the log entry. I returned from a vacation and I have driveway sensors that were triggered as a result of a burglary and I thought it'd be great to see if EG "saw" the person coming and going while I was gone. REALLY hard to do without a date in the log file.

User avatar
kgschlosser
Site Admin
Posts: 4495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Add day/date to log file entries?

Post by kgschlosser » Tue Oct 04, 2016 7:26 pm

if you go into c:\ProgramFiles(x86)\EventGhost\eg\Classes\MainFrame there is a file called LogCtrl.py

you can open this file up in notepad. it is a text file. but i would suggest using a text editor that can show line numbers.

but you will still be able to search for this line

Code: Select all

strftime(" %H:%M:%S   ", localtime(when))
and change it to this

Code: Select all

strftime(" %x - %H:%M:%S   ", localtime(when))
that should give you the date in the log entries as well

:D

enjoy

K
If you like the work I have been doing then feel free to Image

wysocki
Experienced User
Posts: 55
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: Add day/date to log file entries?

Post by wysocki » Mon Oct 10, 2016 10:44 pm

Thanks much! Found it on line 257. Actually I just added a %d instead of the %x since all I wanted was the day number. Just gotta remember to include that if I install an update to EG!

User avatar
kgschlosser
Site Admin
Posts: 4495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Add day/date to log file entries?

Post by kgschlosser » Thu Oct 13, 2016 11:03 am

no worries. just make a text file in your documents called EG upgrades. and only put the line number, the file name and location and the actual code snippet. this way you can go back through and re add them if you upgrade EG at all.
If you like the work I have been doing then feel free to Image

wysocki
Experienced User
Posts: 55
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: Add day/date to log file entries?

Post by wysocki » Tue Jan 01, 2019 2:52 am

Sorry to reopen an old thread, but I just downloaded the 0.5.0 RC6 update and had a question about applying this patch. On line 255 I see strftime(self._datetime_fmt, localtime(when)) as the relevant code. Is self._datetime_fmt a variable defined elsewhere to format the timestamp? If so, where? Would it be better to edit the variable definition or just hardcoding the format string on line 255?

User avatar
kgschlosser
Site Admin
Posts: 4495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Add day/date to log file entries?

Post by kgschlosser » Tue Jan 01, 2019 8:47 am

you cannot use this update in EG 0.5 RC6 because of code changes that have moved things all about. In RC6 you can add the date or the time or both if you want. we added this feature to the core code. check the view drop down menu.
If you like the work I have been doing then feel free to Image

wysocki
Experienced User
Posts: 55
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: Add day/date to log file entries?

Post by wysocki » Tue Jan 01, 2019 10:19 pm

Beautiful! I just noticed it myself this morning. After examining the code more, I figured there had to be some config settings somewhere in this version. THANKS!!!

User avatar
kgschlosser
Site Admin
Posts: 4495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Add day/date to log file entries?

Post by kgschlosser » Wed Jan 02, 2019 12:49 am

werd..

just because it seems like we don't listen doesn't mean we aren't.. :shock:
we do our best to add the features that the horde want to have
If you like the work I have been doing then feel free to Image

User avatar
topix
Experienced User
Posts: 440
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Add day/date to log file entries?

Post by topix » Sun Jan 06, 2019 1:00 pm

The format of the datestamp can be set in the options dialog. See examples at http://strftime.org/ for relevant codes.

Post Reply