From: Florian Forster Date: Fri, 15 Dec 2023 13:53:57 +0000 (+0100) Subject: format_json: only log errors when a `yajl_gen_` call fails. X-Git-Tag: 6.0.0-rc0~18^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b58382eae6cbb214c99738446cae21f935f7416;p=thirdparty%2Fcollectd.git format_json: only log errors when a `yajl_gen_` call fails. --- diff --git a/src/utils/format_json/open_telemetry.c b/src/utils/format_json/open_telemetry.c index e4f83b97c..1f02628c1 100644 --- a/src/utils/format_json/open_telemetry.c +++ b/src/utils/format_json/open_telemetry.c @@ -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)