X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.c;h=3682fa5bb307cad9a2793aa290fbb192d5b59db6;hb=6a5ea214ee92faad825f927e54c64575432cb328;hp=a134446ba24d36a4b33f1f0f7e122641a2819fb3;hpb=eb083585c8d77f56b107e07e203f7a0594f79d3e;p=collectd.git diff --git a/src/plugin.c b/src/plugin.c index a134446b..3682fa5b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1547,14 +1547,6 @@ void plugin_log (int level, const char *format, ...) va_list ap; llentry_t *le; - if (list_log == NULL) - { - va_start (ap, format); - vfprintf (stderr, format, ap); - va_end (ap); - return; - } - #if !COLLECT_DEBUG if (level >= LOG_DEBUG) return; @@ -1565,6 +1557,12 @@ void plugin_log (int level, const char *format, ...) msg[sizeof (msg) - 1] = '\0'; va_end (ap); + if (list_log == NULL) + { + fprintf (stderr, "%s\n", msg); + return; + } + le = llist_head (list_log); while (le != NULL) {