From: Florian Forster Date: Mon, 19 Dec 2011 14:17:39 +0000 (+0100) Subject: src/common.c: parse_value: Be more verbose about parsing problems. X-Git-Tag: collectd-4.10.5~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e6f12dfba76b295d40e835d310d69d625ede88e;p=collectd.git src/common.c: parse_value: Be more verbose about parsing problems. Change-Id: I784ec4ee9a1e89a82fdc9da54ed1fafd3d9c3e57 --- diff --git a/src/common.c b/src/common.c index c3e502ad..d2a1b362 100644 --- a/src/common.c +++ b/src/common.c @@ -876,12 +876,15 @@ int parse_value (const char *value, value_t *ret_value, int ds_type) } if (value == endptr) { - ERROR ("parse_value: Failed to parse string as number: %s.", value); + ERROR ("parse_value: Failed to parse string as %s: %s.", + DS_TYPE_TO_STRING (ds_type), value); return -1; } else if ((NULL != endptr) && ('\0' != *endptr)) - WARNING ("parse_value: Ignoring trailing garbage after number: %s.", - endptr); + INFO ("parse_value: Ignoring trailing garbage \"%s\" after %s value. " + "Input string was \"%s\".", + endptr, DS_TYPE_TO_STRING (ds_type), value); + return 0; } /* int parse_value */