From c0e0611ef314191dfbea1d9936812cf11f7ecdc3 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 1 Jan 2022 20:34:28 +0100 Subject: [PATCH] BSB logger: fixup --- bsb/logger/burrow-bsb-logger.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bsb/logger/burrow-bsb-logger.c b/bsb/logger/burrow-bsb-logger.c index dbcc154..4fbef56 100644 --- a/bsb/logger/burrow-bsb-logger.c +++ b/bsb/logger/burrow-bsb-logger.c @@ -34,20 +34,18 @@ static void mqtt_publish(const char *topic, const char *fmt, ...) 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) -- 2.39.2