}
} /* void plugin_log */
-void plugin_complain (int level, complain_t *c, const char *format, ...)
-{
- char message[512];
- va_list ap;
-
- if (c->delay > 0)
- {
- c->delay--;
- return;
- }
-
- if (c->interval < interval_g)
- c->interval = interval_g;
- else
- c->interval *= 2;
-
- if (c->interval > 86400)
- c->interval = 86400;
-
- c->delay = c->interval / interval_g;
-
- va_start (ap, format);
- vsnprintf (message, 512, format, ap);
- message[511] = '\0';
- va_end (ap);
-
- plugin_log (level, message);
-}
-
-void plugin_relief (int level, complain_t *c, const char *format, ...)
-{
- char message[512];
- va_list ap;
-
- if (c->interval == 0)
- return;
-
- c->interval = 0;
-
- va_start (ap, format);
- vsnprintf (message, 512, format, ap);
- message[511] = '\0';
- va_end (ap);
-
- plugin_log (level, message);
-}
-
const data_set_t *plugin_get_ds (const char *name)
{
data_set_t *ds;
};
typedef struct data_set_s data_set_t;
-typedef struct complain_s
-{
- unsigned int interval; /* how long we wait for reporting this error again */
- unsigned int delay; /* how many more iterations we still need to wait */
-} complain_t;
-
typedef struct notification_s
{
int severity;
# define DEBUG(...) /* noop */
#endif /* ! COLLECT_DEBUG */
-/* TODO: Move plugin_{complain,relief} into `utils_complain.[ch]'. -octo */
-void plugin_complain (int level, complain_t *c, const char *format, ...);
-void plugin_relief (int level, complain_t *c, const char *format, ...);
-
const data_set_t *plugin_get_ds (const char *name);
#endif /* PLUGIN_H */