#ifndef _TFE_KAFKA_LOGGER_H
#define _TFE_KAFKA_LOGGER_H

#ifdef __cpluscplus
extern "C"
{
#endif

#include <tfe_utils.h>
#include <librdkafka/rdkafka.h>

    typedef struct tfe_kafka_logger_s
    {
        int enable;

        unsigned int local_ip_num;
        char local_ip_str[TFE_SYMBOL_MAX];

        char topic_name[TFE_STRING_MAX];
        char broker_list[TFE_STRING_MAX];

        rd_kafka_t *kafka_handle;
        rd_kafka_topic_t *kafka_topic;
    } tfe_kafka_logger_t;

    tfe_kafka_logger_t *tfe_kafka_logger_create(int enable, const char *nic_name, const char *brokerlist, const char *topic_name,
                                                 const char *sasl_username, const char *sasl_passwd, void *local_logger);
    void tfe_kafka_logger_destroy(tfe_kafka_logger_t *logger);
    int tfe_kafka_logger_send(tfe_kafka_logger_t *logger, const char *data, int len);

#ifdef __cpluscplus
}
#endif

#endif
