loggingservices/eventlogger/LogCli/src/LOGCLI.CPP
changeset 0 08ec8eefde2f
child 55 44f437012c90
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 // System includes
       
    17 #include <bautils.h>
       
    18 #include <barsc2.h> // For CResourceFile
       
    19 #include <barsread2.h> // For RResourceReader
       
    20 #include <logwrap.h>
       
    21 
       
    22 // User includes
       
    23 #include <logcli.h>
       
    24 #include "logservcli.h"
       
    25 #include "LogServShared.h"
       
    26 #include "logpackage.h"
       
    27 #include "logclipanic.h"
       
    28 #include "logclientop.h"
       
    29 #include "LogClientObserver.h"
       
    30 
       
    31 //**********************************
       
    32 // TLogConfig
       
    33 //**********************************
       
    34 
       
    35 /** Sets the:
       
    36 
       
    37 maximum age of events to zero
       
    38 
       
    39 maximum number of events to appear in the log to zero
       
    40 
       
    41 maximum number of events to appear in a recent event list to zero */
       
    42 EXPORT_C TLogConfig::TLogConfig()
       
    43 : iMaxLogSize(0), iMaxRecentLogSize(0), iMaxEventAge(0)
       
    44 	{
       
    45 	}
       
    46 
       
    47 void TLogConfig::InternalizeL(RReadStream& aStream)
       
    48 	{
       
    49 	aStream >> iMaxLogSize;
       
    50 	aStream >> iMaxRecentLogSize;
       
    51 	aStream >> iMaxEventAge;
       
    52 	}
       
    53 
       
    54 void TLogConfig::ExternalizeL(RWriteStream& aStream) const
       
    55 	{
       
    56 	aStream << iMaxLogSize;
       
    57 	aStream << iMaxRecentLogSize;
       
    58 	aStream << iMaxEventAge;
       
    59 	}
       
    60 
       
    61 //**********************************
       
    62 // CLogClient
       
    63 //**********************************
       
    64 
       
    65 EXPORT_C CLogClient* CLogClient::NewL(RFs& aFs, TInt aPriority/* = CActive::EPriorityStandard*/)
       
    66 	{
       
    67 	CLogClient* self = new(ELeave)CLogClient(aFs, aPriority);
       
    68 	CleanupStack::PushL(self);
       
    69 	self->ConstructL();
       
    70 	CleanupStack::Pop(); // self
       
    71 	return self;
       
    72 	}
       
    73 
       
    74 void CLogClient::ConstructL()
       
    75 	{
       
    76 	// Load resources
       
    77 	LoadResourcesL(iFs);
       
    78 
       
    79 	iSession = new(ELeave)RLogSession;
       
    80 	User::LeaveIfError(iSession->Connect());
       
    81 	iPackage = CLogPackage::NewL();
       
    82 
       
    83 	iAddEvent = new(ELeave)CLogAddEventClientOp(*iSession, *iPackage, Priority());
       
    84 	iChangeEvent = new(ELeave)CLogChangeEventClientOp(*iSession, *iPackage, Priority());
       
    85 	iGetEvent = new(ELeave)CLogGetEventClientOp(*iSession, *iPackage, Priority());
       
    86 	iDeleteEvent = new(ELeave)CLogDeleteEventClientOp(*iSession, *iPackage, Priority());
       
    87 	iAddType = new(ELeave)CLogAddTypeClientOp(*iSession, *iPackage, Priority());
       
    88 	iChangeType = new(ELeave)CLogChangeTypeClientOp(*iSession, *iPackage, Priority());
       
    89 	iGetType = new(ELeave)CLogGetTypeClientOp(*iSession, *iPackage, Priority());
       
    90 	iDeleteType = new(ELeave)CLogDeleteTypeClientOp(*iSession, *iPackage, Priority());
       
    91 	iGetConfig = new(ELeave)CLogGetConfigClientOp(*iSession, *iPackage, Priority());
       
    92 	iChangeConfig = new(ELeave)CLogChangeConfigClientOp(*iSession, *iPackage, Priority());
       
    93 	iClearLog = new(ELeave)CLogClearLogClientOp(*iSession, *iPackage, Priority());
       
    94 	iClearRecent = new(ELeave)CLogClearRecentClientOp(*iSession, *iPackage, Priority());
       
    95 	}
       
    96 
       
    97 /** Frees all resources owned by the Log Engine object prior to its destruction. 
       
    98 In particular, any outstanding asynchronous request is cancelled, the database, 
       
    99 the database session and the resource file are all closed. */
       
   100 EXPORT_C CLogClient::~CLogClient()
       
   101 	{
       
   102 	Cancel();
       
   103 
       
   104 	delete iChangeObserver;
       
   105 	if (iSession && iSession->Handle())
       
   106 		{
       
   107 		// Complete change notification
       
   108 		NotifyChangeCancel();
       
   109 		iSession->Close();
       
   110 		}
       
   111 
       
   112 	delete iSession;
       
   113 	delete iPackage;
       
   114 	delete iAddEvent;
       
   115 	delete iChangeEvent;
       
   116 	delete iGetEvent;
       
   117 	delete iDeleteEvent;
       
   118 	delete iAddType;
       
   119 	delete iChangeType;
       
   120 	delete iGetType;
       
   121 	delete iDeleteType;
       
   122 	delete iGetConfig;
       
   123 	delete iChangeConfig;
       
   124 	delete iClearLog;
       
   125 	delete iClearRecent;
       
   126 	}
       
   127 
       
   128 CLogClient::CLogClient(RFs& aFs, TInt aPriority)
       
   129 : CLogBase(aPriority), iFs(aFs)
       
   130 	{
       
   131 	}
       
   132 
       
   133 /** Adds an event to the log database. This is an asynchronous request.
       
   134 
       
   135 There must be no asynchronous request outstanding when this function is called, 
       
   136 otherwise the function raises a LogCli 0 panic.
       
   137 
       
   138 @param aEvent A log event detail object containing the attributes of the event 
       
   139 to be added. The Log Engine sets the unique event ID, the UTC time and the event 
       
   140 description, replacing any supplied values. The caller must ensure that this 
       
   141 object remains in existence and valid until the request is complete.
       
   142 @param aStatus The request status. On request completion,contains: KErrNone, 
       
   143 if the event has been successfully added to the log database; KErrNotFound, 
       
   144 if the event type is not registered with the Log Engine; KErrNotSupported, 
       
   145 if the logging of events of this type has been disabled; otherwise, one of 
       
   146 the other system wide error codes.
       
   147 @capability Note For built-in event types, the required capability level is defined in
       
   148 the event type's write access policy.
       
   149 @see CLogEventType::SetLoggingEnabled() */
       
   150 EXPORT_C void CLogClient::AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus)
       
   151 	{
       
   152 	Queue(aStatus);
       
   153 	iAddEvent->Start(aEvent, iStatus);
       
   154 	SetActive();
       
   155 	}
       
   156 
       
   157 /** Changes the details of an existing event. This is an asynchronous request.
       
   158 
       
   159 There must be no asynchronous request outstanding when this function is called, 
       
   160 otherwise the function raises a LogCli 0 panic.
       
   161 
       
   162 Note that it is not possible to change the event type using this function.
       
   163 
       
   164 @param aEvent The event detail object containing the attributes of the event 
       
   165 to be changed. Before calling the function, this object must contain the appropriate 
       
   166 unique event ID; if no unique event ID is set, the function raises a LogCli 
       
   167 13 panic. The caller must ensure that this object remains in existence and 
       
   168 valid until the request is complete.
       
   169 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   170 if successful; otherwise, one of the other system wide error codes.
       
   171 @capability Note For built-in event types, the required capability level is defined in
       
   172 the event type's write access policy.
       
   173 @see TLogId */
       
   174 EXPORT_C void CLogClient::ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus)
       
   175 	{
       
   176 	Queue(aStatus);
       
   177 	iChangeEvent->Start(aEvent, iStatus);
       
   178 	SetActive();
       
   179 	}
       
   180 
       
   181 /** Gets the details of the specified event. This is an asynchronous request.
       
   182 
       
   183 There must be no asynchronous request outstanding when this function is called, 
       
   184 otherwise the function raises a LogCli 0 panic.
       
   185 
       
   186 @param aEvent A reference to a log event detail object. Before calling the 
       
   187 function, this object must contain the appropriate unique event ID; if no 
       
   188 unique event ID is set, the function raises a LogServ 50 panic. The caller 
       
   189 must ensure that this object remains in existence and valid until the request 
       
   190 is complete. On successful completion of the request, it contains the appropriate 
       
   191 log event detail.
       
   192 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   193 if successful; otherwise, one of the other system wide error codes.
       
   194 @capability Note For built-in event types, the required capability level is defined in
       
   195 the event type's read access policy.
       
   196 @see TLogId */
       
   197 EXPORT_C void CLogClient::GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus)
       
   198 	{
       
   199 	Queue(aStatus);
       
   200 	iGetEvent->Start(aEvent, iStatus);
       
   201 	SetActive();
       
   202 	}
       
   203 
       
   204 /** Deletes the event with the specified unique event ID, from the main event log.
       
   205 
       
   206 @param aId The unique event ID of the event to be deleted. This must not be 
       
   207 the null unique event ID, KLogNullId, otherwise the function raises a LogCli 
       
   208 13 panic.
       
   209 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   210 if successful; otherwise, one of the other system wide error codes. 
       
   211 @capability Note For built-in event types, the required capability level is defined in
       
   212 the event type's write access policy.
       
   213 */
       
   214 EXPORT_C void CLogClient::DeleteEvent(TLogId aId, TRequestStatus& aStatus)
       
   215 	{
       
   216 	Queue(aStatus);
       
   217 	iDeleteEvent->Start(aId, iStatus);
       
   218 	SetActive();
       
   219 	}
       
   220 
       
   221 /** Registers a new event type. This is an asynchronous request.
       
   222 
       
   223 There must be no asynchronous request outstanding when this function is called, 
       
   224 otherwise the function raises a LogCli 0 panic.
       
   225 
       
   226 @param aType The event type detail object containing the attributes of the 
       
   227 event type to be registered. The caller must ensure that this object remains 
       
   228 in existence and valid until the request is complete.
       
   229 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   230 if successful; otherwise, one of the other system wide error codes.
       
   231 @capability WriteDeviceData
       
   232 @see TUid */
       
   233 EXPORT_C void CLogClient::AddEventType(const CLogEventType& aType, TRequestStatus& aStatus)
       
   234 	{
       
   235 	Queue(aStatus);
       
   236 	iAddType->Start(aType, iStatus);
       
   237 	SetActive();
       
   238 	}
       
   239 
       
   240 /** Gets the details of an event type. This is an asynchronous request.
       
   241 
       
   242 There must be no asynchronous request outstanding when this function is called, 
       
   243 otherwise the function raises a LogCli 0 panic.
       
   244 
       
   245 @param aType A reference to an event type detail object. Before calling the 
       
   246 function, this object must contain the UID identifying the event type; if 
       
   247 no UID is set, the function raises a LogCli 13 panic. The caller must ensure 
       
   248 that this object remains in existence and valid until the request is complete. 
       
   249 On successful completion of the request, it contains the appropriate event 
       
   250 type detail.
       
   251 @param aStatus The request status. On request completion, contains: KErrNone, 
       
   252 if successful; otherwise one of the other system wide error codes.
       
   253 @capability Note None required.
       
   254 @see TUid */
       
   255 EXPORT_C void CLogClient::GetEventType(CLogEventType& aType, TRequestStatus& aStatus)
       
   256 	{
       
   257 	Queue(aStatus);
       
   258 	iGetType->Start(aType, iStatus);
       
   259 	SetActive();
       
   260 	}
       
   261 
       
   262 /** Changes the details of an existing event type. This is an asynchronous request.
       
   263 
       
   264 There must be no asynchronous request outstanding when this function is called, 
       
   265 otherwise the function raises a LogCli 0 panic.
       
   266 
       
   267 @param aType The event type detail object containing the attributes of the 
       
   268 event type to be changed. Before calling the function, this object must contain 
       
   269 the UID identifying the event type; if no UID is set, the function raises 
       
   270 a LogCli 13 panic. The caller must ensure that this object remains in existence 
       
   271 and valid until the request is complete.
       
   272 @param aStatus The request status. On request completion, contains: KErrNone, 
       
   273 if successful; otherwise, one of the other system wide error codes.
       
   274 @capability WriteDeviceData
       
   275 @see TUid */
       
   276 EXPORT_C void CLogClient::ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus)
       
   277 	{
       
   278 	Queue(aStatus);
       
   279 	iChangeType->Start(aType, iStatus);
       
   280 	SetActive();
       
   281 	}
       
   282 
       
   283 /** Removes an existing event type. This is an asynchronous request.
       
   284 
       
   285 There must be no asynchronous request outstanding when this function is called, 
       
   286 otherwise the function raises a LogCli 0 panic.
       
   287 
       
   288 Note that this function does not remove events from the event log, so it is 
       
   289 possible to have events in the log that are of an unknown type. This function 
       
   290 allows an event type associated with a component to be removed when that component 
       
   291 is uninstalled.
       
   292 
       
   293 @param aId The UID of the event type to be deleted.
       
   294 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   295 if successful; otherwise, one of the other system wide error codes. 
       
   296 @capability WriteDeviceData
       
   297 */
       
   298 EXPORT_C void CLogClient::DeleteEventType(TUid aId, TRequestStatus& aStatus)
       
   299 	{
       
   300 	Queue(aStatus);
       
   301 	iDeleteType->Start(aId, iStatus);
       
   302 	SetActive();
       
   303 	}
       
   304 
       
   305 /** Gets the Log Engine configuration. This is an asynchronous request.
       
   306 
       
   307 There must be no asynchronous request outstanding when this function is called, 
       
   308 otherwise the function raises a LogCli 0 panic.
       
   309 
       
   310 @param aConfig A reference to a Log Engine configuration object. The caller 
       
   311 must ensure that this object remains in existence and valid until the request 
       
   312 is complete. On successful completion of the request, it contains the Log 
       
   313 Engine configuration data.
       
   314 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   315 if successful; otherwise, one of the other system wide error codes. 
       
   316 @capability Note None required.
       
   317 */
       
   318 EXPORT_C void CLogClient::GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus)
       
   319 	{
       
   320 	Queue(aStatus);
       
   321 	iGetConfig->Start(aConfig, iStatus);
       
   322 	SetActive();
       
   323 	}
       
   324 
       
   325 /** Changes the Log Engine configuration. This is an asynchronous request.
       
   326 
       
   327 There must be no asynchronous request outstanding when this function is called, 
       
   328 otherwise the function raises a LogCli 0 panic.
       
   329 
       
   330 @param aConfig The new configuration values for the Log Engine.
       
   331 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   332 if successful; otherwise, one of the other system wide error codes. 
       
   333 @capability WriteDeviceData */
       
   334 EXPORT_C void CLogClient::ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus)
       
   335 	{
       
   336 	Queue(aStatus);
       
   337 	iChangeConfig->Start(aConfig, iStatus);
       
   338 	SetActive();
       
   339 	}
       
   340 
       
   341 /** Clears all events from the main event log that occurred before the specified 
       
   342 date and time. This is an asynchronous request.
       
   343 
       
   344 There must be no asynchronous request outstanding when this function is called, 
       
   345 otherwise the function raises a LogCli 0 panic.
       
   346 
       
   347 @param aDate The UTC date and time.
       
   348 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   349 if successful; otherwise, one of the other system wide error codes. 
       
   350 @capability WriteDeviceData  */
       
   351 EXPORT_C void CLogClient::ClearLog(const TTime& aDate, TRequestStatus& aStatus)
       
   352 	{
       
   353 	Queue(aStatus);
       
   354 	iClearLog->Start(aDate, iStatus);
       
   355 	SetActive();
       
   356 	}
       
   357 
       
   358 /** Clears the specified recent event list. This is an asynchronous request.
       
   359 
       
   360 There must be no asynchronous request outstanding when this function is called, 
       
   361 otherwise the function raises a LogCli 0 panic.
       
   362 
       
   363 @param aRecentList Identifies the recent event list to be cleared. The value 
       
   364 KlogNullRecentList indicates that all recent event lists are to be cleared.
       
   365 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   366 if successful; otherwise, one of the other system wide error codes. 
       
   367 @capability WriteDeviceData  */
       
   368 EXPORT_C void CLogClient::ClearLog(TInt aRecentList, TRequestStatus& aStatus)
       
   369 	{
       
   370 	Queue(aStatus);
       
   371 	iClearRecent->Start((TLogRecentList)aRecentList, iStatus);
       
   372 	SetActive();
       
   373 	}
       
   374 
       
   375 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   376 
       
   377 /** 
       
   378 Clears all events from the main event log that occurred before the specified 
       
   379 date and time and logged with the supplied SIM short Id. This is an asynchronous request.
       
   380 
       
   381 There must be no asynchronous request outstanding when this function is called, 
       
   382 otherwise the function raises a LogCli 0 panic.
       
   383 
       
   384 Note: If KLogNullSimId is passed as value of aSimId parameter, then the method will produce the same result as the
       
   385            ClearLog() method without SimId parameter - all events occured before  the specified data will be deleted,
       
   386 	disregarding the SimId event property.
       
   387 
       
   388 @param aDate   The UTC date and time.
       
   389 @param aSimId  SIM card short Id.
       
   390 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   391                if successful; otherwise, one of the other system wide error codes. 
       
   392 @capability WriteDeviceData  
       
   393 */
       
   394 EXPORT_C void CLogClient::ClearLog(const TTime& aDate, TSimId aSimId, TRequestStatus& aStatus)
       
   395 	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is defined
       
   396 	Queue(aStatus);
       
   397 	iClearLog->Start(aDate, iStatus, aSimId);
       
   398 	SetActive();
       
   399 	}
       
   400 
       
   401 /** 
       
   402 Clears the specified recent event list from events with the specified SIM short Id. 
       
   403 This is an asynchronous request.
       
   404 
       
   405 There must be no asynchronous request outstanding when this function is called, 
       
   406 otherwise the function raises a LogCli 0 panic.
       
   407 
       
   408 Note: If KLogNullSimId is passed as value of aSimId parameter, then the method will produce the same result as the
       
   409            ClearLog() method without SimId parameter - all events from the specified event list will be cleared,
       
   410 	disregarding the SimId event property.
       
   411 
       
   412 @param aRecentList Identifies the recent event list to be cleared. The value 
       
   413                    KlogNullRecentList indicates that all recent event lists are to be cleared.
       
   414 @param aSimId      SIM card short Id.
       
   415 @param aStatus     The request status. On request completion, contains:KErrNone, 
       
   416                    if successful; otherwise, one of the other system wide error codes. 
       
   417 @capability WriteDeviceData  
       
   418 */
       
   419 EXPORT_C void CLogClient::ClearLog(TInt aRecentList, TSimId aSimId, TRequestStatus& aStatus)
       
   420 	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is defined
       
   421 	Queue(aStatus);
       
   422 	iClearRecent->Start((TLogRecentList)aRecentList, iStatus, aSimId);
       
   423 	SetActive();
       
   424 	}
       
   425 
       
   426 #else //SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
       
   427 
       
   428 #pragma BullseyeCoverage off
       
   429 
       
   430 /**
       
   431 Not supported. 
       
   432 */
       
   433 EXPORT_C void CLogClient::ClearLog(const TTime&, TSimId, TRequestStatus&)
       
   434 	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is not defined
       
   435 	__ASSERT_ALWAYS(0, ::Panic(ELogDualSimNotSupported));
       
   436 	}
       
   437 
       
   438 /**
       
   439 Not supported. 
       
   440 */
       
   441 EXPORT_C void CLogClient::ClearLog(TInt, TSimId, TRequestStatus&)
       
   442 	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is not defined
       
   443 	__ASSERT_ALWAYS(0, ::Panic(ELogDualSimNotSupported));
       
   444 	}
       
   445 
       
   446 #pragma BullseyeCoverage on
       
   447 
       
   448 #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
       
   449 
       
   450 /** Requests notification of changes to the Log Engine database. This is an asynchronous 
       
   451 request.
       
   452 
       
   453 The function requires the caller to specify a minimum time that must elapse 
       
   454 before this notification request can complete. The Log Engine buffers all 
       
   455 changes that occur during this time; the request, then completes after this 
       
   456 minimum time period has elapsed. If no changes occur within this time period, 
       
   457 then the request completes when the next change to the database occurs.
       
   458 
       
   459 There must be no asynchronous request outstanding when this function is called, 
       
   460 otherwise the function raises a LogCli 0 panic.
       
   461 
       
   462 Note that once a notification request has completed, this function must be 
       
   463 called again to get further change notifications.
       
   464 
       
   465 @param aDelay The minimum time, in microseconds, that elapses before the notification 
       
   466 request can complete.
       
   467 @param aStatus The request status. On request completion, contains:KErrNone, 
       
   468 if successful;KErrCancel, if an outstanding notification request is cancelled; 
       
   469 otherwise, one of the other system wide error codes. 
       
   470 @capability Note None required.
       
   471 */
       
   472 EXPORT_C void CLogClient::NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus)
       
   473 	{
       
   474 	aStatus = KRequestPending;
       
   475 
       
   476 	iSession->Send(ELogNotify, TIpcArgs(aDelay.Int()), aStatus);
       
   477 }
       
   478 
       
   479 /** Cancels any outstanding notification request for changes to Log Engine database.
       
   480 
       
   481 This function can be called even if there is no outstanding notification request. 
       
   482 @capability Note None required  */
       
   483 EXPORT_C void CLogClient::NotifyChangeCancel()
       
   484 	{
       
   485 	iSession->Send(ELogNotifyCancel, TIpcArgs());
       
   486 	}
       
   487 
       
   488 /**
       
   489 @capability Note None required
       
   490 */
       
   491 EXPORT_C void CLogClient::SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver)
       
   492 	{
       
   493 	delete iChangeObserver;
       
   494 	iChangeObserver = NULL;
       
   495 	//
       
   496 	if	(aObserver)
       
   497 		{
       
   498 		iChangeObserver = CLogClientObserver::NewL(*this, *aObserver, Priority());
       
   499 		}
       
   500 	}
       
   501 
       
   502 /** Gets a standard string from the specified resource in logwrap.dll resource 
       
   503 file.
       
   504 
       
   505 The function can be used to populate some of the event fields in a CLogEvent 
       
   506 object before creating or changing an event.
       
   507 
       
   508 Note that TLogString is a modifiable buffer descriptor that is guaranteed 
       
   509 to be large enough to contain all standard strings used in the Log Engine; 
       
   510 pass an instance of this type to this function.
       
   511 
       
   512 @param aString A modifiable descriptor into which the string is copied.
       
   513 @param aId The resource id.
       
   514 @return KErrNone, if successful; otherwise, one of the other system wide error 
       
   515 codes.
       
   516 @capability Note None required.
       
   517 @see TLogString */
       
   518 EXPORT_C TInt CLogClient::GetString(TDes& aString, TInt aId) const
       
   519 	{
       
   520 	aString.Zero();
       
   521 	TRAPD(err, DoGetStringL(aString, aId));
       
   522 	return err;
       
   523 	}
       
   524 
       
   525 void CLogClient::DoGetStringL(TDes& aString, TInt aId) const
       
   526 	{
       
   527 	RResourceReader reader;
       
   528 #ifdef _DEBUG
       
   529 	const CResourceFile* rcFile = ResourceFile();
       
   530 	__ASSERT_DEBUG(rcFile != NULL, Panic(ELogNullRcFile));
       
   531 #endif
       
   532 	reader.OpenLC(ResourceFile(), aId);
       
   533 	aString.Copy(reader.ReadTPtrCL());
       
   534 	CleanupStack::PopAndDestroy();			// reader
       
   535 	}
       
   536 
       
   537 void CLogClient::DoCancel()
       
   538 	{
       
   539 	LOGTEXT("CLogClient::DoCancel()");
       
   540 
       
   541 	iAddEvent->Cancel();
       
   542 	iChangeEvent->Cancel();
       
   543 	iGetEvent->Cancel();
       
   544 	iDeleteEvent->Cancel();
       
   545 	iAddType->Cancel();
       
   546 	iChangeType->Cancel();
       
   547 	iGetType->Cancel();
       
   548 	iDeleteType->Cancel();
       
   549 	iGetConfig->Cancel(); 
       
   550 	iChangeConfig->Cancel();
       
   551 	iClearLog->Cancel();
       
   552 	iClearRecent->Cancel();
       
   553 
       
   554 	CLogBase::DoCancel();
       
   555 	LOGTEXT("CLogClient::DoCancel() - end");
       
   556 	}
       
   557 
       
   558 void CLogClient::DoRunL()
       
   559 	{
       
   560 	LOGTEXT2("CLogClient::DoRunL(%d)", iStatus.Int());
       
   561 	User::LeaveIfError(iStatus.Int());
       
   562 	LOGTEXT("CLogClient::DoRunL() - end");
       
   563 	}
       
   564 
       
   565 RLogSession& CLogClient::Session() const
       
   566 	{
       
   567 	return *iSession;
       
   568 	}
       
   569 
       
   570 #pragma BullseyeCoverage off
       
   571 
       
   572 EXPORT_C void CLogClient::CLogBase_Reserved1()
       
   573 	{
       
   574 	}
       
   575 
       
   576 #pragma BullseyeCoverage on