Log
[Protocol Common Services]


Detailed Description

Common Log APIs.


POSTAL LOG NOTIFICATIONS

Defines Log notifications.

#define ALP_POSTAL_LOG_CHANGE_DELETE_ALL   2
 Sent with AlpPostalNotificationLogStatusChangeCallback to indicate that all log entries were deleted from the database for the given serviceId.
#define ALP_POSTAL_LOG_CHANGE_INSERT   1
 Sent with AlpPostalNotificationLogStatusChangeCallback to indicate the reason for the log change notification is because one log entry was inserted to the database. Note that all log entries should have monotonically increasing date stamp properties.
#define ALP_POSTAL_NOTIFICATION_LOG_STATUS_CHANGE
 log status change.
typedef uint32_t alp_postal_log_change_type_t
 see ALP_POSTAL_LOG_CHANGE_*
typedef void(* AlpPostalNotificationLogStatusChangeCallback )(alp_postal_service_id_t iServiceId, alp_postal_log_id_t iLogId, alp_postal_log_level_t iLogLevel, alp_postal_log_change_type_t iLogChangeType)
 log status change notification callback used for ALP_POSTAL_NOTIFICATION_LOG_STATUS_CHANGE notification.

Default values for MaxLogEntries value in SERVICE_SETTINGS

table. This is the maximum number of logs allowed for a plugin. @ {

#define ALP_POSTAL_LOG_DEFAULT_MAX_LOG_ENTRIES_500   (uint32_t)500

Generic values for ALP_POSTAL_PROPERTY_LOG_LEVEL

@ {

#define ALP_POSTAL_LOG_LEVEL_DEBUG   (alp_postal_log_level_t)4
#define ALP_POSTAL_LOG_LEVEL_ERROR   (alp_postal_log_level_t)1
#define ALP_POSTAL_LOG_LEVEL_INFO   (alp_postal_log_level_t)3
#define ALP_POSTAL_LOG_LEVEL_WARN   (alp_postal_log_level_t)2

POSTAL LOG PROPERTIES

Defines common log properties.

#define ALP_POSTAL_PROPERTY_LOG_ACCOUNT_ID
 The alp_postal_account_id_t that was in use when the log entry was generated. (optional).
#define ALP_POSTAL_PROPERTY_LOG_ENVELOPE_ID
 The alp_postal_envelope_id_t that was in use when the log entry was generated. (optional).
#define ALP_POSTAL_PROPERTY_LOG_EXTRA_MESSAGE
 An optional string, such as a server response or debug message that should be displayed with the log entry. Note that the application should primarily rely on localized translations of strings generated in response to the ALP_POSTAL_PROPERTY_LOG_TYPE for displaying information about the log entry. This property should only be used to store extra unlocalized debugging or server response messages associated with the log type.
#define ALP_POSTAL_PROPERTY_LOG_FOLDER_ID
 The alp_postal_folder_id_t that was in use when the log entry was generated. (optional).
#define ALP_POSTAL_PROPERTY_LOG_ID
 Log ID Unique ID of the log entry (rowid).
#define ALP_POSTAL_PROPERTY_LOG_LEVEL
 The log level of the log entry. Log Level values must be defined by the plugins.
#define ALP_POSTAL_PROPERTY_LOG_SERVICE_ID
 The alp_postal_service_id_t that generated the log entry.
#define ALP_POSTAL_PROPERTY_LOG_TIMESTAMP
 timedate log entry was added
#define ALP_POSTAL_PROPERTY_LOG_TYPE
 Each service may define a list of integer values to identify a type of log entry that has meaning to that service.

Defines

#define ALP_POSTAL_LOG_INVALID_ID   ((alp_postal_log_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 Invalid Account ID definition.

Typedefs

typedef uint8_t alp_postal_log_level_t
 Log level type. Each plugin can define their own list of up to 256 different log levels that can be filtered using the log enumerator API.
typedef uint8_t alp_postal_log_type_t
 Used with ALP_POSTAL_PROPERTY_LOG_TYPE property. Each plugin should define their own set of values for log types.
typedef _AlpPostalPropertyList AlpPostalLog
 AlpPostalLog.

Functions

alp_status_t alp_postal_log_clear (alp_postal_service_id_t iServiceId)
 Deletes all log entries for a given serviceId.
alp_status_t alp_postal_log_create_entry (AlpPostalLog *iLogP, alp_postal_log_id_t *oLogIdP)
 Inserts a new log entry for a given serviceId.
alp_status_t alp_postal_log_free (AlpPostalLog *iLogP)
 Free the given Log.
alp_status_t alp_postal_log_get (alp_postal_log_id_t iLogId, AlpPostalLog *oLogP)
 Get the log properties list of a stored Postal Log.
alp_status_t alp_postal_log_get_enumerator (AlpPostalServiceIdList *iServiceIdListP, alp_postal_log_level_t iMaxLogLevel, AlpPostalEnumerator *oLogEnumeratorP)
 Get an enumerator of log entries who's log level is less than or equal to iMaxLogLevel. Entries are always sorted by timestamp in descending order.
alp_status_t alp_postal_log_get_id (AlpPostalLog *iLogP, alp_postal_log_id_t *oLogIdP)
 Get the id of a log structure provided by the server, otherwise id won't exist.
alp_status_t alp_postal_log_get_next (AlpPostalEnumerator *iLogEnumeratorP, AlpPostalLog *oLogP)
 Return the log structure for the current position and increment it.
alp_status_t alp_postal_log_get_property (AlpPostalLog *iLogP, alp_postal_property_id_t iPropertyId, AlpPostalProperty **oLogPropertyP)
 Retrieve a property from a Postal Log.
alp_status_t alp_postal_log_init (AlpPostalLog *iLogP)
 Initialize a log entry. MUST be called before use.
alp_status_t alp_postal_log_init_enumerator (AlpPostalEnumerator *iEnumeratorP)
 Initialize a log enumerator. MUST be called before alp_postal_log_get_enumerator API.
alp_status_t alp_postal_log_release_enumerator (AlpPostalEnumerator *iEnumeratorP)
 free datas into the enumerator and release it, must be called when data access is over.
alp_status_t alp_postal_log_set_property (AlpPostalLog *ioLogP, alp_postal_property_id_t iLogPropertyId, alp_postal_property_const_value_t iLogPropertyDataP, uint16_t iLogPropertyDataSize)
 Set a property to a Postal Log.


Define Documentation

#define ALP_POSTAL_LOG_CHANGE_DELETE_ALL   2
 

Sent with AlpPostalNotificationLogStatusChangeCallback to indicate that all log entries were deleted from the database for the given serviceId.

#define ALP_POSTAL_LOG_CHANGE_INSERT   1
 

Sent with AlpPostalNotificationLogStatusChangeCallback to indicate the reason for the log change notification is because one log entry was inserted to the database. Note that all log entries should have monotonically increasing date stamp properties.

#define ALP_POSTAL_LOG_DEFAULT_MAX_LOG_ENTRIES_500   (uint32_t)500
 

#define ALP_POSTAL_LOG_INVALID_ID   ((alp_postal_log_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 

Invalid Account ID definition.

#define ALP_POSTAL_LOG_LEVEL_DEBUG   (alp_postal_log_level_t)4
 

#define ALP_POSTAL_LOG_LEVEL_ERROR   (alp_postal_log_level_t)1
 

#define ALP_POSTAL_LOG_LEVEL_INFO   (alp_postal_log_level_t)3
 

#define ALP_POSTAL_LOG_LEVEL_WARN   (alp_postal_log_level_t)2
 

#define ALP_POSTAL_NOTIFICATION_LOG_STATUS_CHANGE
 

Value:

log status change.

#define ALP_POSTAL_PROPERTY_LOG_ACCOUNT_ID
 

Value:

The alp_postal_account_id_t that was in use when the log entry was generated. (optional).

#define ALP_POSTAL_PROPERTY_LOG_ENVELOPE_ID
 

Value:

The alp_postal_envelope_id_t that was in use when the log entry was generated. (optional).

#define ALP_POSTAL_PROPERTY_LOG_EXTRA_MESSAGE
 

Value:

An optional string, such as a server response or debug message that should be displayed with the log entry. Note that the application should primarily rely on localized translations of strings generated in response to the ALP_POSTAL_PROPERTY_LOG_TYPE for displaying information about the log entry. This property should only be used to store extra unlocalized debugging or server response messages associated with the log type.

#define ALP_POSTAL_PROPERTY_LOG_FOLDER_ID
 

Value:

The alp_postal_folder_id_t that was in use when the log entry was generated. (optional).

#define ALP_POSTAL_PROPERTY_LOG_ID
 

Value:

Log ID Unique ID of the log entry (rowid).

#define ALP_POSTAL_PROPERTY_LOG_LEVEL
 

Value:

The log level of the log entry. Log Level values must be defined by the plugins.

#define ALP_POSTAL_PROPERTY_LOG_SERVICE_ID
 

Value:

The alp_postal_service_id_t that generated the log entry.

#define ALP_POSTAL_PROPERTY_LOG_TIMESTAMP
 

Value:

timedate log entry was added

#define ALP_POSTAL_PROPERTY_LOG_TYPE
 

Value:

Each service may define a list of integer values to identify a type of log entry that has meaning to that service.


Typedef Documentation

typedef uint32_t alp_postal_log_change_type_t
 

see ALP_POSTAL_LOG_CHANGE_*

typedef uint8_t alp_postal_log_level_t
 

Log level type. Each plugin can define their own list of up to 256 different log levels that can be filtered using the log enumerator API.

typedef uint8_t alp_postal_log_type_t
 

Used with ALP_POSTAL_PROPERTY_LOG_TYPE property. Each plugin should define their own set of values for log types.

typedef struct _AlpPostalPropertyList AlpPostalLog
 

AlpPostalLog.

typedef void(* AlpPostalNotificationLogStatusChangeCallback)(alp_postal_service_id_t iServiceId, alp_postal_log_id_t iLogId, alp_postal_log_level_t iLogLevel, alp_postal_log_change_type_t iLogChangeType)
 

log status change notification callback used for ALP_POSTAL_NOTIFICATION_LOG_STATUS_CHANGE notification.

Parameters:
[in] iServiceId The serviceId of related to the log change
[in] iLogId Valid only if iLogChangeType is ALP_POSTAL_LOG_CHANGE_INSERT
[in] iLogLevel Valid only if iLogChangeType is ALP_POSTAL_LOG_CHANGE_INSERT. Contains the valiue of the ALP_POSTAL_PROPERTY_LOG_LEVEL property for the inserted log
[in] iLogChangeType One of ALP_POSTAL_LOG_CHANGE_*


Function Documentation

alp_status_t alp_postal_log_clear alp_postal_service_id_t  iServiceId  ) 
 

Deletes all log entries for a given serviceId.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
Returns:
Returns an error code.

alp_status_t alp_postal_log_create_entry AlpPostalLog iLogP,
alp_postal_log_id_t oLogIdP
 

Inserts a new log entry for a given serviceId.

Remarks:
The following properties must be set, or else POSTAL_STATUS_INVALID_PARAM will be returned: ALP_POSTAL_PROPERTY_LOG_LEVEL ALP_POSTAL_PROPERTY_LOG_SERVICE_ID ALP_POSTAL_PROPERTY_LOG_ACCOUNT_ID ALP_POSTAL_PROPERTY_LOG_TYPE
Parameters:
[in] iLogP A log entry Ptr.
[out] oLogIdP The id of the created log entry.
Returns:
error POSTAL_STATUS_OK POSTAL_STATUS_INVALID_PARAM - missing log properties

alp_status_t alp_postal_log_free AlpPostalLog iLogP  ) 
 

Free the given Log.

Parameters:
[in] iLogP A log Ptr.
Returns:
Returns an error code.

alp_status_t alp_postal_log_get alp_postal_log_id_t  iLogId,
AlpPostalLog oLogP
 

Get the log properties list of a stored Postal Log.

Parameters:
[in] iLogId The log Id of the stored log entry.
[out] oLogP The result log property list Ptr.
Returns:
Returns an error code.

alp_status_t alp_postal_log_get_enumerator AlpPostalServiceIdList iServiceIdListP,
alp_postal_log_level_t  iMaxLogLevel,
AlpPostalEnumerator oLogEnumeratorP
 

Get an enumerator of log entries who's log level is less than or equal to iMaxLogLevel. Entries are always sorted by timestamp in descending order.

Parameters:
[in] iServiceIdListP List of serviceId's to include in enumerator
[in] iMaxLogLevel Log entries must have a log level equal or less than than this value to be included in the result set. iMaxLogLevel=0 means to include all log levels.
[out] oLogEnumeratorP A reseted enumerator on the result.
Returns:
Returns an error code.

alp_status_t alp_postal_log_get_id AlpPostalLog iLogP,
alp_postal_log_id_t oLogIdP
 

Get the id of a log structure provided by the server, otherwise id won't exist.

Parameters:
[in] iLogP a folder structure Ptr.
[out] oLogIdP the unique id of the log, 0 if it not exist.
Returns:
Returns an error code.

alp_status_t alp_postal_log_get_next AlpPostalEnumerator iLogEnumeratorP,
AlpPostalLog oLogP
 

Return the log structure for the current position and increment it.

Parameters:
[in] iLogEnumeratorP An enumerator on a list of result.
[out] oLogP List of log properties fetched from result
Returns:
Returns an error code.

alp_status_t alp_postal_log_get_property AlpPostalLog iLogP,
alp_postal_property_id_t  iPropertyId,
AlpPostalProperty **  oLogPropertyP
 

Retrieve a property from a Postal Log.

Parameters:
[in] iLogP The Postal Log in which a property must be retrieved.
[in] iPropertyId a log property Id.
[out] oLogPropertyP The Postal Log property to be retrieved.
Returns:
Returns an error code.

alp_status_t alp_postal_log_init AlpPostalLog iLogP  ) 
 

Initialize a log entry. MUST be called before use.

Parameters:
[in] iLogP The Postal Log to be initialized.
Returns:
Returns an error code.

alp_status_t alp_postal_log_init_enumerator AlpPostalEnumerator iEnumeratorP  ) 
 

Initialize a log enumerator. MUST be called before alp_postal_log_get_enumerator API.

Parameters:
[in] iEnumeratorP the enumerator to initialize.
Returns:
Returns an error code.

alp_status_t alp_postal_log_release_enumerator AlpPostalEnumerator iEnumeratorP  ) 
 

free datas into the enumerator and release it, must be called when data access is over.

Parameters:
[in] iEnumeratorP the enumerator to release.
Returns:
Returns an error code.

alp_status_t alp_postal_log_set_property AlpPostalLog ioLogP,
alp_postal_property_id_t  iLogPropertyId,
alp_postal_property_const_value_t  iLogPropertyDataP,
uint16_t  iLogPropertyDataSize
 

Set a property to a Postal Log.

Parameters:
[in,out] ioLogP The Postal Log in which a property must be set.
[in] iLogPropertyId The Id of the property to be created.
[in] iLogPropertyDataP The value of the property to be created.
[in] iLogPropertyDataSize the size of the data, strlen+1 if it's a string
Returns:
Returns an error code.


Generated on Wed Jul 30 07:06:43 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.