From: Sebastian Harl Date: Thu, 22 May 2008 11:37:57 +0000 (+0200) Subject: src/plugin.c: Don't require write callbacks to be present. X-Git-Tag: collectd-4.5.0~144 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5bf80d6ecad0e6684eb38cf2de8e56b4f6b50fe3;p=collectd.git src/plugin.c: Don't require write callbacks to be present. plugin_dispatch_values() used to fail, if no write callbacks had been registered. As that function is used to update the cache and check threshold as well, this limited the flexibility of collectd setups. Thus, the error message has been downgraded to a one-time complaint. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/plugin.c b/src/plugin.c index cbd54775..8844c339 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -21,6 +21,7 @@ **/ #include "collectd.h" +#include "utils_complain.h" #include @@ -744,6 +745,8 @@ void plugin_shutdown_all (void) int plugin_dispatch_values (value_list_t *vl) { + static c_complain_t no_write_complaint = C_COMPLAIN_INIT; + int (*callback) (const data_set_t *, const value_list_t *); data_set_t *ds; llentry_t *le; @@ -754,12 +757,10 @@ int plugin_dispatch_values (value_list_t *vl) } if (list_write == NULL) - { - ERROR ("plugin_dispatch_values: No write callback has been " - "registered. Please load at least one plugin " - "that provides a write function."); - return (-1); - } + c_complain_once (LOG_WARNING, &no_write_complaint, + "plugin_dispatch_values: No write callback has been " + "registered. Please load at least one output plugin, " + "if you want the collected data to be stored."); if (data_sets == NULL) {