diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-E4A950EA-5671-5755-B3EF-5D6B90E19AE6.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-E4A950EA-5671-5755-B3EF-5D6B90E19AE6.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,76 @@ + + + + + +Maintaining +Log Events This tutorial describes how to maintain events using Log Engine. +

You maintain a +log by adding, changing and deleting events with the appropriate calls to +the CLogClient member of your application. When you are +adding or changing events, the arguments are a CLogEvent and +a TRequestStatus object to hold the return value. When +you are deleting, they are a CLogEvent and a TLogId.

It +is sometimes necessary to create a custom event type. If you want to log events +of a custom created event type, you need to initialize a CLogEventType object +and add it to the log. You add the event type when you install your application, +and delete it if you uninstall the application. You add, change and delete +custom event types by calling the appropriate functions of a CLogClient object:

iLogClient->AddEventType(*iLogEventType, +iStatus);

iLogClient->ChangeEventType(*iLogEventType, +iStatus);

iLogClient->DeleteEventType(aId, iStatus);

The +arguments are a CLogEventType (or TUid when +deleting) and a TRequestStatus object.

To maintain +log events, do the following:

+ +declare an event +as a member of your log client class +CLogEvent* iCurrentEvent; + + +initialize the event using its member functions +iCurrentLogEvent = CLogEvent::NewL(); +... +iCurrentLogEvent->SetTime(time); + + +add an event to a log with the AddEvent() function +of a CLogClient object +iLogClient->AddEvent(*iLogEvent, iStatus); + AddEvent() creates an asynchronous request and no +other asynchronous request must be outstanding when you call it. For this +reason, the CLogEvent argument is typically read off a +queue of events waiting to be processed. + + +change an event record with the ChangeEvent() function. +iLogClient->ChangeEvent(*iLogEvent, iStatus); + + +

Note that it is +not possible to change the event type of an event after it has been added +to the log.

The events specified by the log engine clients are maintained.

+

You do not normally +need to delete an event. A log has a maximum size which the log engine maintains +automatically by deleting the oldest events when newly added events would +cause the maximum to be exceeded. If you want to delete an event for other +reasons you call the DeleteEvent() function. iLogClient->DeleteEvent(aLogId, +iStatus);

It is important to know that deleting an event +type and deleting the actual events of that type are two separate actions. +If you just delete the type and not the events, the events will remain in +the log but have no type.

+
+Requesting +Log Engine Notifications +Setting Up +A Log Engine Client +Displaying +Log Events +Configuring +Log Engine +
\ No newline at end of file