Code

src/common.c: parse_value: Be more verbose about parsing problems.
authorFlorian Forster <octo@collectd.org>
Mon, 19 Dec 2011 14:17:39 +0000 (15:17 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 19 Dec 2011 14:17:39 +0000 (15:17 +0100)
Change-Id: I784ec4ee9a1e89a82fdc9da54ed1fafd3d9c3e57

src/common.c

index c3e502ad97f96d478e9890638c9f59ae25489740..d2a1b362429c4ffb5bf049437183b6b5ea328e48 100644 (file)
@@ -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 */