va_list args;
va_start(args, fmt);
- if (1) {
- char m[256];
- int l = vsnprintf(m, sizeof(m), fmt, args);
- int err = mosquitto_publish(mosq, NULL, topic, l, m, 0, true);
- if (err != MOSQ_ERR_SUCCESS)
- mqtt_error("publish", err, false);
- }
+ char m[256];
+ int l = vsnprintf(m, sizeof(m), fmt, args);
+ int err = mosquitto_publish(mosq, NULL, topic, l, m, 0, true);
+ if (err != MOSQ_ERR_SUCCESS)
+ mqtt_error("publish", err, false);
va_end(args);
}
static void mqtt_log_callback(struct mosquitto *mosq UNUSED, void *obj UNUSED, int level, const char *message)
{
- msg(L_INFO, "MQTT(%d): %s", level, message);
+ // msg(L_INFO, "MQTT(%d): %s", level, message);
}
static void mqtt_conn_callback(struct mosquitto *mosq UNUSED, void *obj UNUSED, int status)