Show a patch.

GET /api/patches/11125/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 11125,
    "url": "https://patchwork.libcamera.org/api/patches/11125/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11125/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210203181746.22028-1-m.cichy@pengutronix.de>",
    "date": "2021-02-03T18:17:46",
    "name": "[libcamera-devel] libcamera: log: add colors to log levels",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "36028761591e441d4e29311bfdb7e45b76c31030",
    "submitter": {
        "id": 80,
        "url": "https://patchwork.libcamera.org/api/people/80/?format=api",
        "name": "Marian Cichy",
        "email": "m.cichy@pengutronix.de"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11125/mbox/",
    "series": [
        {
            "id": 1646,
            "url": "https://patchwork.libcamera.org/api/series/1646/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1646",
            "date": "2021-02-03T18:17:46",
            "name": "[libcamera-devel] libcamera: log: add colors to log levels",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1646/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11125/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11125/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 16FB8BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Feb 2021 18:18:05 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A2B36844F;\n\tWed,  3 Feb 2021 19:18:04 +0100 (CET)",
            "from metis.ext.pengutronix.de (metis.ext.pengutronix.de\n\t[IPv6:2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC87468447\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Feb 2021 19:18:03 +0100 (CET)",
            "from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28])\n\tby metis.ext.pengutronix.de with esmtps\n\t(TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)\n\t(envelope-from <mci@pengutronix.de>)\n\tid 1l7Mj5-0006HP-6q; Wed, 03 Feb 2021 19:18:03 +0100",
            "from mci by dude02.hi.pengutronix.de with local (Exim 4.92)\n\t(envelope-from <mci@pengutronix.de>)\n\tid 1l7Mj3-0005k7-3G; Wed, 03 Feb 2021 19:18:01 +0100"
        ],
        "From": "Marian Cichy <m.cichy@pengutronix.de>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  3 Feb 2021 19:17:46 +0100",
        "Message-Id": "<20210203181746.22028-1-m.cichy@pengutronix.de>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "X-SA-Exim-Connect-IP": "2001:67c:670:100:1d::28",
        "X-SA-Exim-Mail-From": "mci@pengutronix.de",
        "X-SA-Exim-Scanned": "No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false",
        "X-PTX-Original-Recipient": "libcamera-devel@lists.libcamera.org",
        "Subject": "[libcamera-devel] [PATCH] libcamera: log: add colors to log levels",
        "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>",
        "Cc": "Marian Cichy <m.cichy@pengutronix.de>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "mono-colored wall of logs can be hard to read and doesn't show the level\nof failure at a first glance. By adding colors to the log level\ncategories, it is much easier to scroll through logs and find important\nentries.\n---\n src/libcamera/log.cpp | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\nindex 45c7c2d2..3ad9c3de 100644\n--- a/src/libcamera/log.cpp\n+++ b/src/libcamera/log.cpp\n@@ -85,11 +85,11 @@ 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\"DEBUG\",\n-\t\t\" INFO\",\n-\t\t\" WARN\",\n-\t\t\"ERROR\",\n-\t\t\"FATAL\",\n+\t\t\"\\033[1m\\033[37mDEBUG\\033[0m\",\n+\t\t\"\\033[1m\\033[32m INFO\\033[0m\",\n+\t\t\"\\033[1m\\033[33m WARN\\033[0m\",\n+\t\t\"\\033[1m\\033[31mERROR\\033[0m\",\n+\t\t\"\\033[1m\\033[35mFATAL\\033[0m\",\n \t};\n \n \tif (static_cast<unsigned int>(severity) < std::size(names))\n",
    "prefixes": [
        "libcamera-devel"
    ]
}