Motion - SQL Event Logging

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

Initial release. -- TimWegener - 18 May 2005

Discussion and Comments

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.

-- KennethLavrsen - 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.

-- KennethLavrsen - 09 Jul 2005

Implemented in a modified version in 3.2.4_snap2

-- KennethLavrsen - 14 Sep 2005
Topic revision: r7 - 20 Dec 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.