»
Symbian OS v6.1 Edition for C++ »
API Reference »
Log Engine »
CLogClient
Location:
logcli.h
Link against: logcli.lib
CLogClient
Support
Supported from 6.0
Description
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.
Derivation
CActive | The core class of the active object abstraction |
CBase | Base class for all classes to be instantiated on the heap |
CLogActive | Common active object behaviour |
CLogBase | Base class for the log engine implementation |
CLogClient | Log Engine implementation |
|
Defined in CLogClient
:
AddEvent()
, AddEventType()
, ChangeConfig()
, ChangeEvent()
, ChangeEventType()
, ClearLog()
, DeleteEvent()
, DeleteEventType()
, GetConfig()
, GetEvent()
, GetEventType()
, GetString()
, NewL()
, NotifyChange()
, NotifyChangeCancel()
, ~CLogClient()
Inherited from CActive
:
Cancel()
,
Deque()
,
DoCancel()
,
EPriorityHigh
,
EPriorityIdle
,
EPriorityLow
,
EPriorityStandard
,
EPriorityUserInput
,
IsActive()
,
IsAdded()
,
Priority()
,
RunError()
,
RunL()
,
SetActive()
,
SetPriority()
,
TPriority
,
iStatus
Inherited from CBase
:
operator new()
See also:
Construction and destruction
static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
Description
A factory function that creates a new instance of the log
engine. This is the first exported function in the DLL.
Parameters
RFs& aFs |
Handle to a file server session through which the database is
created, if necessary.. |
TInt aPriority = CActive::EPriorityStandard |
The priority of this active object. By default, this is the
standard active object priority. |
|
Return value
CLogClient* |
Pointer to the new Log Engine object. |
|
See also:
~CLogClient();
Description
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.
void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
Description
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.
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 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
log event detail. |
TRequestStatus& aStatus |
The request status. On request completion,
contains:KErrNone , if successful; otherwise, one of the other
system wide error codes. |
|
See also:
void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
Description
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.
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. |
|
See also:
void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
Description
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.
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 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. |
|
See also:
void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
Description
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.
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. |
|
See also:
void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
Description
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.
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. |
|
See also:
void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
Description
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.
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. |
|
See also:
void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
Description
Deletes the event with the specified unique event ID, from the main event
log.
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. |
|
void DeleteEventType(TUid aId, TRequestStatus& aStatus);
Description
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
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. |
|
TInt GetString(TDes& aString, TInt aId) const;
Description
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.
Parameters
TDes& aString |
A modifiable descriptor into which the string is copied. |
TInt aId |
The resource id. |
|
Return value
TInt |
KErrNone , if successful; otherwise, one of the other system
wide error codes.
|
|
See also:
void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
Description
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
const TTime& aDate |
The date and time. |
TRequestStatus& aStatus |
The request status. On request completion,
contains:KErrNone , if successful; otherwise, one of the other
system wide error codes. |
|
void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
Description
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
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. |
|
void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
Description
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
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. |
|
void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
Description
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
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. |
|
void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
Description
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
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. |
|
void NotifyChangeCancel();
Description
Cancels any outstanding notification request for changes to Log Engine
database.
This function can be called even if there is no outstanding notification
request.