X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fplugin.h;h=871eccdc5694dbcbc6dff16c8db61e42f0ab27d4;hb=ddeaf8446079a183f790f6426a2835d486d5e1d1;hp=024e53849964bbf05725fee4f6cd850bc527603b;hpb=ce79ade493b71b2c6a3dbc18b07d791739ad0cc2;p=collectd.git diff --git a/src/daemon/plugin.h b/src/daemon/plugin.h index 024e5384..871eccdc 100644 --- a/src/daemon/plugin.h +++ b/src/daemon/plugin.h @@ -399,6 +399,15 @@ int parse_notif_severity(const char *severity); #define DEBUG(...) /* noop */ #endif /* ! COLLECT_DEBUG */ +/* This will log messages, prefixed by plugin name */ +void daemon_log(int level, const char *format, ...) + __attribute__((format(printf, 2, 3))); + +#define P_ERROR(...) daemon_log(LOG_ERR, __VA_ARGS__) +#define P_WARNING(...) daemon_log(LOG_WARNING, __VA_ARGS__) +#define P_NOTICE(...) daemon_log(LOG_NOTICE, __VA_ARGS__) +#define P_INFO(...) daemon_log(LOG_INFO, __VA_ARGS__) + const data_set_t *plugin_get_ds(const char *name); int plugin_notification_meta_add_string(notification_t *n, const char *name,