Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
kaa_logging.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
24 #ifndef KAA_LOGGING_H_
25 #define KAA_LOGGING_H_
26 
27 
28 #include "gen/kaa_logging_definitions.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
41 struct kaa_log_collector_t;
43 
55 typedef struct {
56  uint32_t log_id;
57  uint16_t bucket_id;
59 
61 typedef struct {
62  size_t max_bucket_size;
65 
76 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);
77 
89 kaa_error_t kaa_logging_set_strategy(kaa_log_collector_t *self, void *log_upload_strategy_context);
90 
103 kaa_error_t kaa_logging_set_storage(kaa_log_collector_t *self, void *log_storage_context);
104 
114 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);
115 
126 
127 #ifdef __cplusplus
128 } /* extern "C" */
129 #endif
130 
131 #endif /* KAA_LOGGING_H_ */
size_t max_bucket_size
The maximum bucket size in bytes.
Definition: kaa_logging.h:62
External log upload strategy interface used by Kaa data collection subsystem to decide when to upload...
Log record info.
Definition: kaa_logging.h:55
kaa_error_t
Definition: kaa_error.h:31
External log delivery listener interfaces.
kaa_error_t kaa_logging_set_storage(kaa_log_collector_t *self, void *log_storage_context)
Sets custom storage for given collector.
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...
Listeners aggreate.
Definition: ext_log_delivery_listener.h:55
uint16_t bucket_id
Id of a bucket where a log record contained.
Definition: kaa_logging.h:57
External log storage interface used by Kaa data collection subsystem to temporarily store the logs be...
kaa_error_t kaa_logging_set_strategy(kaa_log_collector_t *self, void *log_upload_strategy_context)
Sets custom strategy for given collector.
uint32_t log_id
Id of a log record processed by kaa_logging_add_record()
Definition: kaa_logging.h:56
Constraints applied to log buckets.
Definition: kaa_logging.h:61
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.
size_t max_bucket_log_count
The maximum log count within a single bucket.
Definition: kaa_logging.h:63
kaa_error_t kaa_logging_set_listeners(kaa_log_collector_t *self, const kaa_log_delivery_listener_t *listeners)
Sets listeners of log events.
struct kaa_log_collector_t kaa_log_collector_t
Definition: kaa_logging.h:42