Displaying
Log Events
This tutorial describes how to display log events.
You create a view
to be displayed in the viewer application by creating a CLogViewEvent or
a CLogViewRecent. Both classes select entries from the
log, usually subject to the constraint of a filter.
CLogViewEvent and CLogViewRecent inherit
functions from CLogView which let you navigate through
the items in the view:
- Create a CLogViewEvent or
a CLogViewRecent class
Set a filter for the logs
iLogViewEvent->SetFilterL(*iLogFilter,iStatus)
A CLogViewRecent has additional functionality to
identify and filter out duplicate events. A view is a purely virtual table
and its add and delete functions have no effect on the log itself.
Create a view from the Log Engine using Event()
A view is a list of events ordered chronologically, earliest first.
A view always has a current event, which you retrieve with Event().
When you create a view the current event is the first event, and you navigate
through the list using the other functions which take a TRequestStatus as
argument.
To get the first event in the view call
if(CViewEvent.FirstL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}
To get the last event in the view call
if(CViewEvent.LastL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
};
To get the last event in the view call
if(CViewEvent.FirstL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}
and then inside a loop call
while(CViewEvent.NextL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}
The view can be displayed to the user.
A recent view is similar to an event view but is designed specifically
for the purpose of displaying such recent events as the distinct voice calls
a device user has received since the last time of checking. In a recent view,
the first event is the most recent.