From c90bd4e0c6ab399c249f4fbf46f61d2e7c5866a5 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 17 Mar 2019 21:30:56 +0000 Subject: [PATCH] Add helper function for internal debug logging. --- src/logging.c | 9 +++++++++ src/mosquitto_broker_internal.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/logging.c b/src/logging.c index 7c256d89..40d46b71 100644 --- a/src/logging.c +++ b/src/logging.c @@ -365,6 +365,15 @@ int log__printf(struct mosquitto *mosq, int priority, const char *fmt, ...) return rc; } +void log__internal(const char *fmt, ...) +{ + va_list va; + + va_start(va, fmt); + log__vprintf(MOSQ_LOG_INTERNAL, fmt, va); + va_end(va); +} + int mosquitto_log_vprintf(int level, const char *fmt, va_list va) { return log__vprintf(level, fmt, va); diff --git a/src/mosquitto_broker_internal.h b/src/mosquitto_broker_internal.h index 565ec7e8..91d69195 100644 --- a/src/mosquitto_broker_internal.h +++ b/src/mosquitto_broker_internal.h @@ -623,6 +623,7 @@ void context__set_state(struct mosquitto *context, enum mosquitto_client_state s int log__init(struct mosquitto__config *config); int log__close(struct mosquitto__config *config); int log__printf(struct mosquitto *mosq, int level, const char *fmt, ...) __attribute__((format(printf, 3, 4))); +void log__internal(const char *fmt, ...) __attribute__((format(printf, 1, 2))); /* ============================================================ * Bridge functions