diff --git a/inc/tsg_send_log.h b/inc/tsg_send_log.h index a609503..711f45b 100644 --- a/inc/tsg_send_log.h +++ b/inc/tsg_send_log.h @@ -18,6 +18,7 @@ typedef enum _tld_type TLD_TYPE_STRING, TLD_TYPE_FILE, TLD_TYPE_TOPIC, + TLD_TYPE_CJSON, // cJSON *object TLD_TYPE_MAX }TLD_TYPE; diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index d62854b..9f03e05 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -19,7 +19,7 @@ #include "tsg_send_log.h" #include "tsg_send_log_internal.h" -char TSG_SEND_LOG_VERSION_20200724=0; +char TSG_SEND_LOG_VERSION_20200729=0; struct tsg_log_instance_t *g_tsg_log_instance; @@ -113,6 +113,9 @@ int TLD_append(struct TLD_handle_t *handle, char *key, void *value, TLD_TYPE typ case TLD_TYPE_STRING: cJSON_AddStringToObject(_handle->object, key, (char *)value); break; + case TLD_TYPE_CJSON: + cJSON_AddItemToObject(_handle->object, key, (cJSON *)value); + break; default: return -1; break;