]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
format_json: only log errors when a `yajl_gen_` call fails.
authorFlorian Forster <octo@collectd.org>
Fri, 15 Dec 2023 13:53:57 +0000 (14:53 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 3 Jan 2024 15:39:36 +0000 (16:39 +0100)
src/utils/format_json/open_telemetry.c

index e4f83b97ca00e0bb2150afe9a14fef3c9e260c9b..1f02628c1405f8930f68758357dc4b08326e6c0b 100644 (file)
@@ -34,7 +34,9 @@
   do {                                                                         \
     int status = (f);                                                          \
     if (status != 0) {                                                         \
-      ERROR("format_json: %s failed with status %d", #f, status);              \
+      if (strncmp(#f, "yajl_gen_", strlen("yajl_gen_")) == 0) {                \
+        ERROR("format_json: %s failed with status %d", #f, status);            \
+      }                                                                        \
       return status;                                                           \
     }                                                                          \
   } while (0)