X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Fplugin.c;fp=src%2Fdaemon%2Fplugin.c;h=92e1ab261288cb7a653aac1f33e68284180625b6;hp=358ee05dd98add5b711e21b9b67479f08ce566e1;hb=bc4f4604ae8a558f2c8c1c40b9fe9649dd9d8266;hpb=6126b9c01e558f1424fa7631e6a6e612a526e66f diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 358ee05d..92e1ab26 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -2244,6 +2244,21 @@ void plugin_log(int level, const char *format, ...) { } } /* void plugin_log */ +void daemon_log(int level, const char *format, ...) { + char msg[1024] = ""; // Size inherits from plugin_log() + + char const *name = plugin_get_ctx().name; + if (name == NULL) + name = "UNKNOWN"; + + va_list ap; + va_start(ap, format); + vsnprintf(msg, sizeof(msg), format, ap); + va_end(ap); + + plugin_log(level, "%s plugin: %s", name, msg); +} /* void daemon_log */ + int parse_log_severity(const char *severity) { int log_level = -1;