Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE task
PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-55ECBCF5-FC29-5A4A-A3C6-1CB1C0D562CE" xml:lang="en"><title>Displaying
Log Events</title><shortdesc>This tutorial describes how to display log events. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-1C8DA1D1-AF6B-5478-AC1C-8D676C3F20CD"><p>You create a view
to be displayed in the viewer application by creating a <xref href="GUID-3A3E6F09-0F78-38E1-95F5-00C743F41073.dita"><apiname>CLogViewEvent</apiname></xref> or
a <xref href="GUID-F40F9556-F223-36A5-9812-6EF6FF3F5156.dita"><apiname>CLogViewRecent</apiname></xref>. Both classes select entries from the
log, usually subject to the constraint of a filter. </p> <p> <xref href="GUID-3A3E6F09-0F78-38E1-95F5-00C743F41073.dita"><apiname>CLogViewEvent</apiname></xref> and <xref href="GUID-F40F9556-F223-36A5-9812-6EF6FF3F5156.dita"><apiname>CLogViewRecent</apiname></xref> inherit
functions from <xref href="GUID-F33ADAF2-FD57-3662-B3AC-1000B69289D6.dita"><apiname>CLogView</apiname></xref> which let you navigate through
the items in the view: </p> <ul>
<li id="GUID-36C5ED26-8C2C-55E0-B4E0-819D96792BBA"><p> <xref href="GUID-EE047643-A3E7-3014-835E-3E2F0B0A6549.dita"><apiname> Event()</apiname></xref> </p> </li>
<li id="GUID-6F490445-C4E1-534F-ACBE-49FFAFFD93CE"><p> <xref href="GUID-FDD1ADE5-BDFA-3BE5-9DDC-2B2FC9258300.dita"><apiname> FirstL()</apiname></xref> </p> </li>
<li id="GUID-B81C17B3-E62F-5FE9-A364-226A2B113E48"><p> <xref href="GUID-0658A566-4771-37AB-8181-2AAA45C65931.dita"><apiname> LastL()</apiname></xref> </p> </li>
<li id="GUID-6C063C43-0885-5813-97B2-347115099379"><p> <xref href="GUID-375DEE08-E364-3403-B994-687CB7DF0B39.dita"><apiname>NextL()</apiname></xref> </p> </li>
<li id="GUID-004184E7-25C0-5BCB-879D-A5EB28DE043F"><p> <xref href="GUID-E3831544-ED8B-376E-AD8C-DDF97A3612A6.dita"><apiname>PreviousL()</apiname></xref> </p> </li>
</ul> </context>
<steps id="GUID-6ECCE6B5-6316-5EBD-9DD7-0C767BB07E19">
<step id="GUID-50196D27-187F-5F5B-B9A0-304F4E2C8E98"><cmd>Create a <xref href="GUID-3A3E6F09-0F78-38E1-95F5-00C743F41073.dita"><apiname>CLogViewEvent</apiname></xref> or
a <xref href="GUID-F40F9556-F223-36A5-9812-6EF6FF3F5156.dita"><apiname>CLogViewRecent</apiname></xref> class </cmd>
</step>
<step id="GUID-ECB3C368-32E9-54BA-BD82-01A2259CD452"><cmd/>
<info>Set a filter for the logs </info>
<stepxmp><codeblock id="GUID-A0A9F42E-1CD3-5EED-96DB-1F981DB0E631" xml:space="preserve"> iLogViewEvent->SetFilterL(*iLogFilter,iStatus)</codeblock> </stepxmp>
<info>A <xref href="GUID-F40F9556-F223-36A5-9812-6EF6FF3F5156.dita"><apiname>CLogViewRecent</apiname></xref> 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. </info>
</step>
<step id="GUID-5B84E2B7-DE91-517E-925A-224FF47F09C7"><cmd/>
<info>Create a view from the Log Engine using <xref href="GUID-EE047643-A3E7-3014-835E-3E2F0B0A6549.dita"><apiname>Event()</apiname></xref> </info>
<info>A view is a list of events ordered chronologically, earliest first.
A view always has a current event, which you retrieve with <xref href="GUID-EE047643-A3E7-3014-835E-3E2F0B0A6549.dita"><apiname>Event()</apiname></xref>.
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 <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref> as
argument. </info>
<substeps id="GUID-9F6BC821-3364-483D-9604-17AC296FD677">
<substep id="GUID-A4C4E378-D6CB-464A-9925-DEAEB255568B"><cmd/>
<info><p>To get the first event in the view call </p><codeblock xml:space="preserve">if(CViewEvent.FirstL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}</codeblock></info>
</substep>
<substep id="GUID-329E6A07-4EAA-432D-91DC-329BF59ECEAD"><cmd/>
<info><p>To get the last event in the view call</p><codeblock xml:space="preserve">if(CViewEvent.LastL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
};</codeblock></info>
</substep>
<substep id="GUID-6438BDE1-297C-4A84-B888-43CFAC0632ED"><cmd/>
<info><p>To get the last event in the view call </p><codeblock xml:space="preserve">if(CViewEvent.FirstL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}</codeblock></info>
</substep>
<substep id="GUID-23286819-525E-49D4-B770-BFC5A90D5884"><cmd/>
<info><p>and then inside a loop call</p><codeblock xml:space="preserve">while(CViewEvent.NextL(aStatus))
{
User::WaitForRequest(aStatus);
CLogEvent e = iViewEvent.Event();
}</codeblock></info>
</substep>
</substeps>
</step>
<step id="GUID-71973716-996F-562A-97B0-A70B102850AF"><cmd/>
<info>The view can be displayed to the user. </info>
</step>
</steps>
<postreq id="GUID-EEECF711-F465-4B09-87DF-485E3437621F"><p>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.
</p></postreq>
</taskbody><related-links>
<link href="GUID-E4A950EA-5671-5755-B3EF-5D6B90E19AE6.dita"><linktext>Maintaining
Log Events</linktext></link>
<link href="GUID-BE65B3A7-04E8-5406-B46A-09E2608E0F1F.dita"><linktext>Requesting
Log Engine Notifications</linktext></link>
<link href="GUID-2022F702-9899-5798-8932-D70119C7177D.dita"><linktext>Setting Up
A Log Engine Client</linktext></link>
<link href="GUID-BCB0E50F-B22E-5964-BB68-BEE1870D9C79.dita"><linktext>Configuring
Log Engine </linktext></link>
</related-links></task>