CLogClient Class Reference

class CLogClient : public CLogBase

Log Engine implementation.

It creates a shared session on the log database and allows log viewers to retrieve events from the log.

The class also provides log administration functions.

Wherever time values are used by this class, they must be specified as UTC rather than local time.

CLogWrapper

Public Member Functions
~CLogClient ()
IMPORT_C void AddEvent ( CLogEvent &, TRequestStatus &)
IMPORT_C void AddEventType (const CLogEventType &, TRequestStatus &)
IMPORT_C void ChangeConfig (const TLogConfig &, TRequestStatus &)
IMPORT_C void ChangeEvent (const CLogEvent &, TRequestStatus &)
IMPORT_C void ChangeEventType (const CLogEventType &, TRequestStatus &)
IMPORT_C void ClearLog (const TTime &, TRequestStatus &)
IMPORT_C void ClearLog ( TInt , TRequestStatus &)
IMPORT_C void ClearLog (const TTime &, TSimId , TRequestStatus &)
IMPORT_C void ClearLog ( TInt , TSimId , TRequestStatus &)
IMPORT_C void DeleteEvent ( TLogId , TRequestStatus &)
IMPORT_C void DeleteEventType ( TUid , TRequestStatus &)
IMPORT_C void GetConfig ( TLogConfig &, TRequestStatus &)
IMPORT_C void GetEvent ( CLogEvent &, TRequestStatus &)
IMPORT_C void GetEventType ( CLogEventType &, TRequestStatus &)
IMPORT_C TInt GetString ( TDes &, TInt )
IMPORT_C CLogClient * NewL ( RFs &, TInt )
IMPORT_C void NotifyChange ( TTimeIntervalMicroSeconds32 , TRequestStatus &)
IMPORT_C void NotifyChangeCancel ()
RLogSession & Session ()
IMPORT_C void SetGlobalChangeObserverL ( MLogClientChangeObserver *)
Private Member Functions
CLogClient ( RFs &, TInt )
IMPORT_C void CLogBase_Reserved1 ()
void ConstructL ()
void DoCancel ()
void DoGetStringL ( TDes &, TInt )
void DoRunL ()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CLogActive::CLogActive(TInt)
CLogActive::Complete(TInt)
CLogActive::Queue(TRequestStatus &)
CLogActive::~CLogActive()
CLogBase::CLogBase(TInt)
CLogBase::LoadResourcesL(RFs &)
CLogBase::ResourceFile()const
CLogBase::~CLogBase()
Inherited Enumerations
CActive:TPriority
Private Attributes
CLogAddEventClientOp * iAddEvent
CLogAddTypeClientOp * iAddType
CLogChangeConfigClientOp * iChangeConfig
CLogChangeEventClientOp * iChangeEvent
CLogClientObserver * iChangeObserver
CLogChangeTypeClientOp * iChangeType
CLogClearLogClientOp * iClearLog
CLogClearRecentClientOp * iClearRecent
CLogDeleteEventClientOp * iDeleteEvent
CLogDeleteTypeClientOp * iDeleteType
RFs & iFs
CLogGetConfigClientOp * iGetConfig
CLogGetEventClientOp * iGetEvent
CLogGetTypeClientOp * iGetType
CLogPackage * iPackage
RLogSession * iSession
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CLogClient(RFs &, TInt)

CLogClient ( RFs & aFs,
TInt aPriority
) [private]

Parameters

RFs & aFs
TInt aPriority

~CLogClient()

IMPORT_C ~CLogClient ( )

Frees all resources owned by the Log Engine object prior to its destruction. In particular, any outstanding asynchronous request is cancelled, the database, the database session and the resource file are all closed.

Member Functions Documentation

AddEvent(CLogEvent &, TRequestStatus &)

IMPORT_C void AddEvent ( CLogEvent & aEvent,
TRequestStatus & aStatus
) [virtual]

Adds an event to the log database. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
Note For built-in event types, the required capability level is defined in the event type's write access policy.
CLogEventType::SetLoggingEnabled()

Parameters

CLogEvent & aEvent A log event detail object containing the attributes of the event to be added. The Log Engine sets the unique event ID, the UTC time and the event description, replacing any supplied values. The caller must ensure that this object remains in existence and valid until the request is complete.
TRequestStatus & aStatus The request status. On request completion,contains: KErrNone, if the event has been successfully added to the log database; KErrNotFound, if the event type is not registered with the Log Engine; KErrNotSupported, if the logging of events of this type has been disabled; otherwise, one of the other system wide error codes.

AddEventType(const CLogEventType &, TRequestStatus &)

IMPORT_C void AddEventType ( const CLogEventType & aType,
TRequestStatus & aStatus
)

Registers a new event type. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
WriteDeviceData
TUid

Parameters

const CLogEventType & aType The event type detail object containing the attributes of the event type to be registered. The caller must ensure that this object remains in existence and valid until the request is complete.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

CLogBase_Reserved1()

IMPORT_C void CLogBase_Reserved1 ( ) [private, virtual]

ChangeConfig(const TLogConfig &, TRequestStatus &)

IMPORT_C void ChangeConfig ( const TLogConfig & aConfig,
TRequestStatus & aStatus
)

Changes the Log Engine configuration. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
WriteDeviceData

Parameters

const TLogConfig & aConfig The new configuration values for the Log Engine.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

ChangeEvent(const CLogEvent &, TRequestStatus &)

IMPORT_C void ChangeEvent ( const CLogEvent & aEvent,
TRequestStatus & aStatus
) [virtual]

Changes the details of an existing event. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

Note that it is not possible to change the event type using this function.

capability
Note For built-in event types, the required capability level is defined in the event type's write access policy.
TLogId

Parameters

const CLogEvent & aEvent The event detail object containing the attributes of the event to be changed. Before calling the function, this object must contain the appropriate unique event ID; if no unique event ID is set, the function raises a LogCli 13 panic. The caller must ensure that this object remains in existence and valid until the request is complete.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

ChangeEventType(const CLogEventType &, TRequestStatus &)

IMPORT_C void ChangeEventType ( const CLogEventType & aType,
TRequestStatus & aStatus
)

Changes the details of an existing event type. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
WriteDeviceData
TUid

Parameters

const CLogEventType & aType The event type detail object containing the attributes of the event type to be changed. Before calling the function, this object must contain the UID identifying the event type; if no UID is set, the function raises a LogCli 13 panic. The caller must ensure that this object remains in existence and valid until the request is complete.
TRequestStatus & aStatus The request status. On request completion, contains: KErrNone, if successful; otherwise, one of the other system wide error codes.

ClearLog(const TTime &, TRequestStatus &)

IMPORT_C void ClearLog ( const TTime & aDate,
TRequestStatus & aStatus
)

Clears all events from the main event log that occurred before the specified date and time. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
WriteDeviceData

Parameters

const TTime & aDate The UTC date and time.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

ClearLog(TInt, TRequestStatus &)

IMPORT_C void ClearLog ( TInt aRecentList,
TRequestStatus & aStatus
)

Clears the specified recent event list. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
WriteDeviceData

Parameters

TInt aRecentList Identifies the recent event list to be cleared. The value KlogNullRecentList indicates that all recent event lists are to be cleared.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

ClearLog(const TTime &, TSimId, TRequestStatus &)

IMPORT_C void ClearLog ( const TTime & aDate,
TSimId aSimid,
TRequestStatus & aStatus
)

Not supported.

Parameters

const TTime & aDate
TSimId aSimid
TRequestStatus & aStatus

ClearLog(TInt, TSimId, TRequestStatus &)

IMPORT_C void ClearLog ( TInt aRecentList,
TSimId aSimid,
TRequestStatus & aStatus
)

Not supported.

Parameters

TInt aRecentList
TSimId aSimid
TRequestStatus & aStatus

ConstructL()

void ConstructL ( ) [private]

DeleteEvent(TLogId, TRequestStatus &)

IMPORT_C void DeleteEvent ( TLogId aId,
TRequestStatus & aStatus
) [virtual]

Deletes the event with the specified unique event ID, from the main event log.

capability
Note For built-in event types, the required capability level is defined in the event type's write access policy.

Parameters

TLogId aId The unique event ID of the event to be deleted. This must not be the null unique event ID, KLogNullId, otherwise the function raises a LogCli 13 panic.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

DeleteEventType(TUid, TRequestStatus &)

IMPORT_C void DeleteEventType ( TUid aId,
TRequestStatus & aStatus
)

Removes an existing event type. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

Note that this function does not remove events from the event log, so it is possible to have events in the log that are of an unknown type. This function allows an event type associated with a component to be removed when that component is uninstalled.

capability
WriteDeviceData

Parameters

TUid aId The UID of the event type to be deleted.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

DoCancel()

void DoCancel ( ) [private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

DoGetStringL(TDes &, TInt)

void DoGetStringL ( TDes & aString,
TInt aId
) const [private]

Parameters

TDes & aString
TInt aId

DoRunL()

void DoRunL ( ) [private, virtual]

GetConfig(TLogConfig &, TRequestStatus &)

IMPORT_C void GetConfig ( TLogConfig & aConfig,
TRequestStatus & aStatus
)

Gets the Log Engine configuration. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
Note None required.

Parameters

TLogConfig & aConfig A reference to a Log Engine configuration object. The caller must ensure that this object remains in existence and valid until the request is complete. On successful completion of the request, it contains the Log Engine configuration data.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

GetEvent(CLogEvent &, TRequestStatus &)

IMPORT_C void GetEvent ( CLogEvent & aEvent,
TRequestStatus & aStatus
) [virtual]

Gets the details of the specified event. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
Note For built-in event types, the required capability level is defined in the event type's read access policy.
TLogId

Parameters

CLogEvent & aEvent A reference to a log event detail object. Before calling the function, this object must contain the appropriate unique event ID; if no unique event ID is set, the function raises a LogServ 50 panic. The caller must ensure that this object remains in existence and valid until the request is complete. On successful completion of the request, it contains the appropriate log event detail.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.

GetEventType(CLogEventType &, TRequestStatus &)

IMPORT_C void GetEventType ( CLogEventType & aType,
TRequestStatus & aStatus
)

Gets the details of an event type. This is an asynchronous request.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

capability
Note None required.
TUid

Parameters

CLogEventType & aType A reference to an event type detail object. Before calling the function, this object must contain the UID identifying the event type; if no UID is set, the function raises a LogCli 13 panic. The caller must ensure that this object remains in existence and valid until the request is complete. On successful completion of the request, it contains the appropriate event type detail.
TRequestStatus & aStatus The request status. On request completion, contains: KErrNone, if successful; otherwise one of the other system wide error codes.

GetString(TDes &, TInt)

IMPORT_C TInt GetString ( TDes & aString,
TInt aId
) const [virtual]

Gets a standard string from the specified resource in logwrap.dll resource file.

The function can be used to populate some of the event fields in a CLogEvent object before creating or changing an event.

Note that TLogString is a modifiable buffer descriptor that is guaranteed to be large enough to contain all standard strings used in the Log Engine; pass an instance of this type to this function.

capability
Note None required.
TLogString

Parameters

TDes & aString A modifiable descriptor into which the string is copied.
TInt aId The resource id.

NewL(RFs &, TInt)

IMPORT_C CLogClient * NewL ( RFs & aFs,
TInt aPriority = CActive::EPriorityStandard
) [static]

Parameters

RFs & aFs
TInt aPriority = CActive::EPriorityStandard

NotifyChange(TTimeIntervalMicroSeconds32, TRequestStatus &)

IMPORT_C void NotifyChange ( TTimeIntervalMicroSeconds32 aDelay,
TRequestStatus & aStatus
)

Requests notification of changes to the Log Engine database. This is an asynchronous request.

The function requires the caller to specify a minimum time that must elapse before this notification request can complete. The Log Engine buffers all changes that occur during this time; the request, then completes after this minimum time period has elapsed. If no changes occur within this time period, then the request completes when the next change to the database occurs.

There must be no asynchronous request outstanding when this function is called, otherwise the function raises a LogCli 0 panic.

Note that once a notification request has completed, this function must be called again to get further change notifications.

capability
Note None required.

Parameters

TTimeIntervalMicroSeconds32 aDelay The minimum time, in microseconds, that elapses before the notification request can complete.
TRequestStatus & aStatus The request status. On request completion, contains:KErrNone, if successful;KErrCancel, if an outstanding notification request is cancelled; otherwise, one of the other system wide error codes.

NotifyChangeCancel()

IMPORT_C void NotifyChangeCancel ( )

Cancels any outstanding notification request for changes to Log Engine database.

This function can be called even if there is no outstanding notification request.
capability
Note None required

Session()

RLogSession & Session ( ) const

SetGlobalChangeObserverL(MLogClientChangeObserver *)

IMPORT_C void SetGlobalChangeObserverL ( MLogClientChangeObserver * aObserver )
capability
Note None required

Parameters

MLogClientChangeObserver * aObserver

Member Data Documentation

CLogAddEventClientOp * iAddEvent

CLogAddEventClientOp * iAddEvent [private]

CLogAddTypeClientOp * iAddType

CLogAddTypeClientOp * iAddType [private]

CLogChangeConfigClientOp * iChangeConfig

CLogChangeConfigClientOp * iChangeConfig [private]

CLogChangeEventClientOp * iChangeEvent

CLogChangeEventClientOp * iChangeEvent [private]

CLogClientObserver * iChangeObserver

CLogClientObserver * iChangeObserver [private]

CLogChangeTypeClientOp * iChangeType

CLogChangeTypeClientOp * iChangeType [private]

CLogClearLogClientOp * iClearLog

CLogClearLogClientOp * iClearLog [private]

CLogClearRecentClientOp * iClearRecent

CLogClearRecentClientOp * iClearRecent [private]

CLogDeleteEventClientOp * iDeleteEvent

CLogDeleteEventClientOp * iDeleteEvent [private]

CLogDeleteTypeClientOp * iDeleteType

CLogDeleteTypeClientOp * iDeleteType [private]

RFs & iFs

RFs & iFs [private]

CLogGetConfigClientOp * iGetConfig

CLogGetConfigClientOp * iGetConfig [private]

CLogGetEventClientOp * iGetEvent

CLogGetEventClientOp * iGetEvent [private]

CLogGetTypeClientOp * iGetType

CLogGetTypeClientOp * iGetType [private]

CLogPackage * iPackage

CLogPackage * iPackage [private]

RLogSession * iSession

RLogSession * iSession [private]