From patchwork Mon Jul 29 22:31:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 263089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3ACC12C0104 for ; Tue, 30 Jul 2013 08:32:06 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1V3vz3-0000Li-DK; Mon, 29 Jul 2013 22:32:05 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1V3vyy-0000Kq-4J for fwts-devel@lists.ubuntu.com; Mon, 29 Jul 2013 22:32:00 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1V3vyy-0005bU-15 for fwts-devel@lists.ubuntu.com; Mon, 29 Jul 2013 22:32:00 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_log_json: enable json human readable formatting (LP: #1206290) Date: Mon, 29 Jul 2013 23:31:59 +0100 Message-Id: <1375137119-18153-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King The current json log output is hard to read as a human. Enable the json pretty printing to make it easier for mortals to parse by eye. Signed-off-by: Colin Ian King Acked-by: Alex Hung --- src/lib/src/fwts_log_json.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/src/fwts_log_json.c b/src/lib/src/fwts_log_json.c index a67bc3a..15b28bd 100644 --- a/src/lib/src/fwts_log_json.c +++ b/src/lib/src/fwts_log_json.c @@ -216,7 +216,8 @@ static void fwts_log_close_json(fwts_log_file *log_file) fwts_log_section_end_json(log_file); - str = json_object_to_json_string(json_stack[0].obj); + str = json_object_to_json_string_ext( + json_stack[0].obj, JSON_C_TO_STRING_PRETTY); if (str == NULL) { /* Let's not make this bail out as user may be logging to other files too */ fprintf(stderr, "Cannot turn json object to text for output. Empty json output\n");