From: Zbigniew Jędrzejewski-Szmek Date: Wed, 29 Apr 2026 09:20:06 +0000 (+0200) Subject: sd-json: stop printing debug messages about extension fields X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9e0883316d119fb484c677f27ba24f31baded72;p=thirdparty%2Fsystemd.git sd-json: stop printing debug messages about extension fields The intent was good, but we now print two or three of those messages for each report metrics received on the wire. If the json object is extensible, then it's all good and we don't need to inundate the user with this trivial information. (And the message also sounds like something is wrong or unexpected, when it totally isn't.) ... (string):1:73: Unrecognized object field 'object', assuming extension. (string):1:89: Unrecognized object field 'value', assuming extension. json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"virbr0","value":"degraded-carrier"},"continues":true} (string):1:66: Unrecognized object field 'object', assuming extension. (string):1:83: Unrecognized object field 'value', assuming extension. json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"lo","value":"carrier"},"continues":true} (string):1:66: Unrecognized object field 'object', assuming extension. (string):1:79: Unrecognized object field 'value', assuming extension. json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"wlp0s20f3","value":"carrier"},"continues":true} (string):1:66: Unrecognized object field 'object', assuming extension. (string):1:86: Unrecognized object field 'value', assuming extension. ... --- diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index 4c541275c42..fbc2e55d23f 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -5294,10 +5294,8 @@ _public_ int sd_json_dispatch_full( done++; } else { - if (flags & SD_JSON_ALLOW_EXTENSIONS) { - json_log(value, flags|SD_JSON_DEBUG, 0, "Unrecognized object field '%s', assuming extension.", sd_json_variant_string(key)); + if (flags & SD_JSON_ALLOW_EXTENSIONS) continue; - } json_log(value, flags, 0, "Unexpected object field '%s'.", sd_json_variant_string(key)); if (flags & SD_JSON_PERMISSIVE)