report: use JSON-SEQ when outputing a series of json objects

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.
This commit is contained in:
Lennart Poettering
2026-02-18 15:48:46 +01:00
parent fc5537635d
commit cd961ea209

View 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 {