Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions
kaa_logging.h File Reference

Kaa data logging subsystem API. More...

#include "gen/kaa_logging_definitions.h"
#include "platform/ext_log_storage.h"
#include "platform/ext_log_upload_strategy.h"
#include "platform/ext_log_delivery_listener.h"

Go to the source code of this file.

Data Structures

struct  kaa_log_record_info_t
 Log record info. More...
 
struct  kaa_log_bucket_constraints_t
 Constraints applied to log buckets. More...
 

Typedefs

typedef struct kaa_log_collector_t kaa_log_collector_t
 

Functions

kaa_error_t kaa_logging_init (kaa_log_collector_t *self, void *log_storage_context, void *log_upload_strategy_context, const kaa_log_bucket_constraints_t *bucket_sizes)
 Initializes data collection module with the storage interface, upload strategy, and other settings. More...
 
kaa_error_t kaa_logging_set_strategy (kaa_log_collector_t *self, void *log_upload_strategy_context)
 Sets custom strategy for given collector. More...
 
kaa_error_t kaa_logging_set_storage (kaa_log_collector_t *self, void *log_storage_context)
 Sets custom storage for given collector. More...
 
kaa_error_t kaa_logging_add_record (kaa_log_collector_t *self, kaa_user_log_record_t *entry, kaa_log_record_info_t *log_info)
 Serializes and adds a log record to the log storage. More...
 
kaa_error_t kaa_logging_set_listeners (kaa_log_collector_t *self, const kaa_log_delivery_listener_t *listeners)
 Sets listeners of log events. More...
 

Detailed Description

Kaa data logging subsystem API.

Supplies API for Kaa data collection / logging subsystem.

Typedef Documentation

Function Documentation

kaa_error_t kaa_logging_add_record ( kaa_log_collector_t self,
kaa_user_log_record_t *  entry,
kaa_log_record_info_t log_info 
)

Serializes and adds a log record to the log storage.

Parameters
[in]selfPointer to a kaa_log_collector_t instance.
[in]entryPointer to log entry to be added to the storage.
[out]log_infoPointer to log info. May be NULL.
Returns
Error code.
kaa_error_t kaa_logging_init ( kaa_log_collector_t self,
void *  log_storage_context,
void *  log_upload_strategy_context,
const kaa_log_bucket_constraints_t bucket_sizes 
)

Initializes data collection module with the storage interface, upload strategy, and other settings.

Parameters
[in]selfPointer to a kaa_log_collector_t instance.
[in]log_storage_contextLog storage context.
[in]log_upload_strategy_contextLog upload strategy context.
[in]bucket_sizesBucket size constraints.
Returns
Error code.
kaa_error_t kaa_logging_set_listeners ( kaa_log_collector_t self,
const kaa_log_delivery_listener_t listeners 
)

Sets listeners of log events.

Parameters
[in]selfPointer to a kaa_log_collector_t instance.
[in]listenersPointer to listeners that will be used to handle various log delivery events.
See Also
KAA_LOG_EMPTY_LISTENERS can be used to unsubscribe from log events.
Returns
Error code.
kaa_error_t kaa_logging_set_storage ( kaa_log_collector_t self,
void *  log_storage_context 
)

Sets custom storage for given collector.

If a storage has been assigned to collector previously then it will be destroyed and new storage will be assigned. Be aware that all items from previous storage will be deleted.

Parameters
[in]selfPointer to a kaa_log_collector_t instance.
[in]log_storage_contextLog storage context.
Returns
Error code.
kaa_error_t kaa_logging_set_strategy ( kaa_log_collector_t self,
void *  log_upload_strategy_context 
)

Sets custom strategy for given collector.

If a strategy has been assigned to collector previously then it will be destroyed and new strategy will be assigned.

Parameters
[in]selfPointer to a kaa_log_collector_t instance.
[in]log_upload_strategy_contextLog storage context.
Returns
Error code.