{"id":2758,"url":"https://patchwork.libcamera.org/api/patches/2758/?format=json","web_url":"https://patchwork.libcamera.org/patch/2758/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200129121000.23135-1-kieran.bingham@ideasonboard.com>","date":"2020-01-29T12:10:00","name":"[libcamera-devel,v3] libcamera: log: Expand log level names","commit_ref":"1a6d0f5e9a46f7bd32af1a0b2667f14e7911f93d","pull_url":null,"state":"accepted","archived":false,"hash":"d912fb21d8792827260639535c1b6d4e1d29c858","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2758/mbox/","series":[{"id":649,"url":"https://patchwork.libcamera.org/api/series/649/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=649","date":"2020-01-29T12:10:00","name":"[libcamera-devel,v3] libcamera: log: Expand log level names","version":3,"mbox":"https://patchwork.libcamera.org/series/649/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2758/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2758/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D627608C6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jan 2020 13:10:13 +0100 (CET)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C8DA0516;\n\tWed, 29 Jan 2020 13:10:12 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1580299813;\n\tbh=Lx6jz8VcUNy6JOhO16qbUWxOx04iseechbqrPkvCQpw=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=NTkmH17speSHQRnnKVjLxAH+zbLM3Y2tlmeZa95yptprS/iYKr2jKYtBauhuUW+ZV\n\tXPrXWAR0C4BHybhZELC1crUpJ8R/lTtlQFMch/OvTPjNsAxpkGsPBqyrgtshWzwS9F\n\tOYc5/f+I8IlNhJ0ITjr2oUS5vCTNLjkek7ZgC4uw=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Date":"Wed, 29 Jan 2020 12:10:00 +0000","Message-Id":"<20200129121000.23135-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3] libcamera: log: Expand log level names","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 29 Jan 2020 12:10:13 -0000"},"content":"When the log severity names were added, there was only 4 characters\nreserved for their printing. When the FATAL level was added, this\nincreased to 5, and thus both DBG and ERR can be expanded to their full\nspelling. This also brings the levels in line with the representation\nthat can be used when calling logSetLevel().\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n\nv3:\n - Rebase to master with Trhead::currentID() section.\n\nv2:\n - Expand commit message\n - Expand spacing before the log severity name is printed.\n\n\n src/libcamera/log.cpp | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)","diff":"diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\nindex 1c82dc68fb0f..fd1b5c39a52e 100644\n--- a/src/libcamera/log.cpp\n+++ b/src/libcamera/log.cpp\n@@ -84,10 +84,10 @@ static int log_severity_to_syslog(LogSeverity severity)\n static const char *log_severity_name(LogSeverity severity)\n {\n \tstatic const char *const names[] = {\n-\t\t\"  DBG\",\n+\t\t\"DEBUG\",\n \t\t\" INFO\",\n \t\t\" WARN\",\n-\t\t\"  ERR\",\n+\t\t\"ERROR\",\n \t\t\"FATAL\",\n \t};\n \n@@ -198,7 +198,7 @@ void LogOutput::write(const LogMessage &msg)\n \tcase LoggingTargetStream:\n \tcase LoggingTargetFile:\n \t\tstr = \"[\" + utils::time_point_to_string(msg.timestamp()) + \"] [\"\n-\t\t    + std::to_string(Thread::currentId()) + \"]\"\n+\t\t    + std::to_string(Thread::currentId()) + \"] \"\n \t\t    + log_severity_name(msg.severity()) + \" \"\n \t\t    + msg.category().name() + \" \" + msg.fileInfo() + \" \"\n \t\t    + msg.msg();\n","prefixes":["libcamera-devel","v3"]}