mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
JSON Lines text format (JSONL) [1] is a line-delimited JSON format where objects are separated by the new line character (\n, LF) as opposed to the JSON Sequence text format (json-seq) where JSON text is encapsulated in an ASCII Record Separator (0x1E, RS) and ASCII Line Feed character (0x0A, LF). Whilst JSONL is also used for data streaming, this simpler format is better suited for logging and works also well with traditional line-oriented Unix tooling (e.g. grep or sed). Add this format to util_fmt so that users have more choice and control over formats that are required for their usecases. Add helper functions that let the user determine whether a given format type is JSON in general or a JSON streaming format (such as json-seq or jsonl). For better readability and more clarity use the helper function util_fmt_is_json_stream() where the same decision is made for both JSON streaming formats FMT_JSONSEQ and FMT_JSONL. [1] https://jsonlines.org/ Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>