CLogClient Class Reference

#include <logcli.h>

Link against: logcli.lib

class CLogClient : public CLogBase

Inherits from

Public Member Functions
~CLogClient()
virtual IMPORT_C voidAddEvent(CLogEvent &, TRequestStatus &)
IMPORT_C voidAddEventType(const CLogEventType &, TRequestStatus &)
IMPORT_C voidChangeConfig(const TLogConfig &, TRequestStatus &)
virtual IMPORT_C voidChangeEvent(const CLogEvent &, TRequestStatus &)
IMPORT_C voidChangeEventType(const CLogEventType &, TRequestStatus &)
IMPORT_C voidClearLog(const TTime &, TRequestStatus &)
IMPORT_C voidClearLog(TInt, TRequestStatus &)
IMPORT_C voidClearLog(const TTime &, TSimId, TRequestStatus &)
IMPORT_C voidClearLog(TInt, TSimId, TRequestStatus &)
virtual IMPORT_C voidDeleteEvent(TLogId, TRequestStatus &)
IMPORT_C voidDeleteEventType(TUid, TRequestStatus &)
IMPORT_C voidGetConfig(TLogConfig &, TRequestStatus &)
virtual IMPORT_C voidGetEvent(CLogEvent &, TRequestStatus &)
IMPORT_C voidGetEventType(CLogEventType &, TRequestStatus &)
virtual IMPORT_C TIntGetString(TDes &, TInt)
IMPORT_C CLogClient *NewL(RFs &, TInt)
IMPORT_C voidNotifyChange(TTimeIntervalMicroSeconds32, TRequestStatus &)
IMPORT_C voidNotifyChangeCancel()
RLogSession &Session()
IMPORT_C voidSetGlobalChangeObserverL(MLogClientChangeObserver *)
Inherited Attributes
CActive::iStatus
Inherited Enumerations
CActive:TPriority
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()

Detailed Description

Log Engine implementation.

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

The class also provides log administration functions.

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

See also: CLogWrapper

Constructor & Destructor Documentation

~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 Function Documentation

AddEvent ( CLogEvent &, TRequestStatus & )

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

Reimplemented from CLogBase::AddEvent(CLogEvent &,TRequestStatus &)

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.

If the contact matching is enabled and the contact id of the event to be added is not set, then the EventLogger server will attempt to retrieve the contact id from the MLogCntModel interface. If a matching contact is found then the event contact property will be initialized with the found contact id. See CLogContact class for more details regarding the contact matching.

If the remote party property of the event to be added is not set, and a matching contact was found as a result of the performed contact matching, then the EventLogger server will attempt to retrieve the contact name from the MLogCntModel interface and initialize the event remote party with the contact name.

See also: CLogContact CLogEventType::SetLoggingEnabled()

Parameters
aEventA 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.
aStatusThe 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.
Capability
NoteFor built-in event types, the required capability level is defined in the event type's write access policy.

AddEventType ( const CLogEventType &, TRequestStatus & )

IMPORT_C voidAddEventType(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.

See also: TUid

Parameters
aTypeThe 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.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

ChangeConfig ( const TLogConfig &, TRequestStatus & )

IMPORT_C voidChangeConfig(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.

Parameters
aConfigThe new configuration values for the Log Engine.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

ChangeEvent ( const CLogEvent &, TRequestStatus & )

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

Reimplemented from CLogBase::ChangeEvent(const CLogEvent &,TRequestStatus &)

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.

If the contact matching is enabled and the contact id of the event to be changed is not set, then the EventLogger server will attempt to retrieve the contact id from the MLogCntModel interface. If a matching contact is found then the event contact property will be initialized with the found contact id. See CLogContact class for more details regarding the contact matching.

If the remote party property of the event to be changed is not set, and a matching contact was found as a result of the performed contact matching, then the EventLogger server will attempt to retrieve the contact name from the MLogCntModel interface and initialize the event remote party with the contact name.

See also: TLogId

Parameters
aEventThe 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.
aStatusThe request status. On request completion, contains: KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
NoteFor built-in event types, the required capability level is defined in the event type's write access policy.

ChangeEventType ( const CLogEventType &, TRequestStatus & )

IMPORT_C voidChangeEventType(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.

See also: TUid

Parameters
aTypeThe 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.
aStatusThe request status. On request completion, contains: KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

ClearLog ( const TTime &, TRequestStatus & )

IMPORT_C voidClearLog(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.

Parameters
aDateThe UTC date and time.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

ClearLog ( TInt, TRequestStatus & )

IMPORT_C voidClearLog(TIntaRecentList,
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.

Parameters
aRecentListIdentifies the recent event list to be cleared. The value KlogNullRecentList indicates that all recent event lists are to be cleared.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

ClearLog ( const TTime &, TSimId, TRequestStatus & )

IMPORT_C voidClearLog(const TTime &aDate,
TSimIdaSimid,
TRequestStatus &aStatus
)

Not supported.

ClearLog ( TInt, TSimId, TRequestStatus & )

IMPORT_C voidClearLog(TIntaRecentList,
TSimIdaSimid,
TRequestStatus &aStatus
)

Not supported.

DeleteEvent ( TLogId, TRequestStatus & )

IMPORT_C voidDeleteEvent(TLogIdaId,
TRequestStatus &aStatus
)[virtual]

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

Parameters
aIdThe 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.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
NoteFor built-in event types, the required capability level is defined in the event type's write access policy.

DeleteEventType ( TUid, TRequestStatus & )

IMPORT_C voidDeleteEventType(TUidaId,
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.

Parameters
aIdThe UID of the event type to be deleted.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
WriteDeviceData

GetConfig ( TLogConfig &, TRequestStatus & )

IMPORT_C voidGetConfig(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.

Parameters
aConfigA 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.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
NoteNone required.

GetEvent ( CLogEvent &, TRequestStatus & )

IMPORT_C voidGetEvent(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.

See also: TLogId

Parameters
aEventA 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.
aStatusThe request status. On request completion, contains:KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
NoteFor built-in event types, the required capability level is defined in the event type's read access policy.

GetEventType ( CLogEventType &, TRequestStatus & )

IMPORT_C voidGetEventType(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.

See also: TUid

Parameters
aTypeA 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.
aStatusThe request status. On request completion, contains: KErrNone, if successful; otherwise one of the other system wide error codes.
Capability
NoteNone required.

GetString ( TDes &, TInt )

IMPORT_C TIntGetString(TDes &aString,
TIntaId
)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.

See also: TLogString

Parameters
aStringA modifiable descriptor into which the string is copied.
aIdThe resource id.
Return Value
KErrNone, if successful; otherwise, one of the other system wide error codes.
Capability
NoteNone required.

NewL ( RFs &, TInt )

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

NotifyChange ( TTimeIntervalMicroSeconds32, TRequestStatus & )

IMPORT_C voidNotifyChange(TTimeIntervalMicroSeconds32aDelay,
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.

Parameters
aDelayThe minimum time, in microseconds, that elapses before the notification request can complete.
aStatusThe 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.
Capability
NoteNone required.

NotifyChangeCancel ( )

IMPORT_C voidNotifyChangeCancel()

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
NoteNone required

Session ( )

RLogSession &Session()const

SetGlobalChangeObserverL ( MLogClientChangeObserver * )

IMPORT_C voidSetGlobalChangeObserverL(MLogClientChangeObserver *aObserver)
Capability
NoteNone required