SQL Event Logging
This patch adds an extra field to the SQL database when entries added. The field is called 'event_time_stamp' and is the time stamp at the start of the event. The purpose is to allow easy cataloguing of events.
Description of Patch
This patch modifies event.c only. It only modifies the event_sqlnewfile, using the existing cnt->eventtime attribute for the time stamp data source.
I have tested it in the real world and it appears to work fine. However, users must add an extra 'event_time_stamp' column to the database they use with motion.
Installation of Patch
patch -p1 < motion-3.2.1_snap13_event_patch.txt
(This patch was made using 'diff -Naur')
Change History of Patch
- 18 May 2005
I will add this AFTER the 3.2.1. I would not want to add a new feature without testing just before a release. But the patch as such is OK for including in 3.2.2.
- 22 May 2005
I am not going to include this after all. I have a better idea of creating a generic event text feature which can be used both for filenames using %v and for inclusion as a field in the databases. So in reality your patch will be the implemented as a function and I will use your code for the data base part.
I have started a feature discussion EventConvertionSpecifierDiscussion
and on the Mailing List.
Reminder to myself. When this gets implemented the localtime must be done like this
struct tm eventstarttime;
memcpy(&eventstarttime, localtime(&cnt->eventtime), sizeof(struct tm));
because localtime uses static memory area and is not threadsafe.
- 09 Jul 2005
Implemented in a modified version in 3.2.4_snap2
- 14 Sep 2005