]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
report: use JSON-SEQ when outputing a series of json objects
authorLennart Poettering <lennart@amutable.com>
Wed, 18 Feb 2026 14:48:46 +0000 (15:48 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 20 Feb 2026 07:25:12 +0000 (08:25 +0100)
We do this in our other tools that output a large number of JSON objects
in a potentially streamable way, hence do so here too.

src/report/report.c

index 281491c577cd96986362062a1f3fa9891d283095..3c2f89e00290941512dfda307a21a7e2f1816a6e 100644 (file)
@@ -586,6 +586,9 @@ static int verb_metrics(int argc, char *argv[], void *userdata) {
         assert(argc >= 1);
         assert(argv);
 
+        /* Enable JSON-SEQ mode here, since we'll dump a large series of JSON objects */
+        arg_json_format_flags |= SD_JSON_FORMAT_SEQ;
+
         if (streq_ptr(argv[0], "metrics"))
                 action = ACTION_LIST;
         else {