src/rdkafka.c
void rd_kafka_log0 (const rd_kafka_conf_t *conf,
                    const rd_kafka_t *rk,
                    const char *extra, int level,
                    const char *fac, const char *fmt, ...) {
	char buf[2048];
	va_list ap;
	unsigned int elen = 0;
        unsigned int of = 0;

	if (level > conf->log_level)
		return;

	if (conf->log_thread_name) {
		elen = rd_snprintf(buf, sizeof(buf), "[thrd:%s]: ",
				   rd_kafka_thread_name);
		if (unlikely(elen >= sizeof(buf)))
			elen = sizeof(buf);
		of = elen;
	}

	if (extra) {
		elen = rd_snprintf(buf+of, sizeof(buf)-of, "%s: ", extra);
		if (unlikely(elen >= sizeof(buf)-of))
			elen = sizeof(buf)-of;
                of += elen;
	}

	va_start(ap, fmt);
	rd_vsnprintf(buf+of, sizeof(buf)-of, fmt, ap);
	va_end(ap);

        rd_kafka_log_buf(conf, rk, level, fac, buf);
}
/**
 * @brief Logger
 *
 * @remark conf must be set, but rk may be NULL
 */
@brief Logger
@remark conf must be set, but rk may be NULL
@brief Logger @remark conf must be set but rk may be NULL
void rd_kafka_log0 (const rd_kafka_conf_t *conf,
                    const rd_kafka_t *rk,
                    const char *extra, int level,
                    const char *fac, const char *fmt, ...) {
	char buf[2048];
	va_list ap;
	unsigned int elen = 0;
        unsigned int of = 0;
	if (level > conf->log_level)
		return;
	if (conf->log_thread_name) {
		elen = rd_snprintf(buf, sizeof(buf), "[thrd:%s]: ",
				   rd_kafka_thread_name);
		if (unlikely(elen >= sizeof(buf)))
			elen = sizeof(buf);
		of = elen;
	}
	if (extra) {
		elen = rd_snprintf(buf+of, sizeof(buf)-of, "%s: ", extra);
		if (unlikely(elen >= sizeof(buf)-of))
			elen = sizeof(buf)-of;
                of += elen;
	}
	va_start(ap, fmt);
	rd_vsnprintf(buf+of, sizeof(buf)-of, fmt, ap);
	va_end(ap);
        rd_kafka_log_buf(conf, rk, level, fac, buf);
}
void rd_kafka_log0 ( const rd_kafka_conf_t * conf , const rd_kafka_t * rk , const char * extra , int level , const char * fac , const char * fmt , ... ) { char buf [ 2048 ] ; va_list ap ; unsigned int elen = 0 ; unsigned int of = 0 ; if ( level > conf -> log_level ) return ; if ( conf -> log_thread_name ) { elen = rd_snprintf ( buf , sizeof ( buf ) , " " , rd_kafka_thread_name ) ; if ( unlikely ( elen >= sizeof ( buf ) ) ) elen = sizeof ( buf ) ; of = elen ; } if ( extra ) { elen = rd_snprintf ( buf + of , sizeof ( buf ) - of , " " , extra ) ; if ( unlikely ( elen >= sizeof ( buf ) - of ) ) elen = sizeof ( buf ) - of ; of += elen ; } va_start ( ap , fmt ) ; rd_vsnprintf ( buf + of , sizeof ( buf ) - of , fmt , ap ) ; va_end ( ap ) ; rd_kafka_log_buf ( conf , rk , level , fac , buf ) ; }
@brief Logger
 @remark conf must be set, but rk may be NULL
@brief Logger @remark conf must be set but rk may be NULL