Show a patch.

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

{
    "id": 2685,
    "url": "https://patchwork.libcamera.org/api/patches/2685/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2685/",
    "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": "<20200118213348.16561-3-laurent.pinchart@ideasonboard.com>",
    "date": "2020-01-18T21:33:48",
    "name": "[libcamera-devel,2/2] libcamera: log: Print the thread ID in the log",
    "commit_ref": "026b3af8c2154ad2670528dc4ca7703ca15a64cc",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "278f220dd34559d62dd1fd64580233da460b10cf",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2685/mbox/",
    "series": [
        {
            "id": 639,
            "url": "https://patchwork.libcamera.org/api/series/639/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=639",
            "date": "2020-01-18T21:33:46",
            "name": "Make log messages more thread-friendly",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/639/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2685/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2685/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EFB58607C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 18 Jan 2020 22:34:07 +0100 (CET)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8F84997A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 18 Jan 2020 22:34:07 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579383247;\n\tbh=Gk0IkXje+/XEZItjaqunjcjycI5ec76JYckGXi99qLY=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=U0mcBsMoNZLi0OtbeWIz1rPrnl717wlJCw9zqn7/cb47uJ3T/+aOixHY3GV9QJer3\n\tLBTXzmKIFwGyZi3SqmfOkpiied1UiYeykhyN+bp9HdzGc1s3lNqXXf55v8puvnzd4B\n\t7a4pRrTo20+/ayLy43tRay7CSHTz2myIH5zThw3c=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 18 Jan 2020 23:33:48 +0200",
        "Message-Id": "<20200118213348.16561-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20200118213348.16561-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20200118213348.16561-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: log: Print the thread ID\n\tin the log",
        "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": "Sat, 18 Jan 2020 21:34:08 -0000"
    },
    "content": "The current thread ID is useful when debugging concurrency issues. Print\nit in log messages. The syslog target is left out as the thread ID would\nhave little use there, and partly duplicates the process ID.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/log.cpp | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\nindex f4eb8c11adc3..1dac4666b435 100644\n--- a/src/libcamera/log.cpp\n+++ b/src/libcamera/log.cpp\n@@ -22,6 +22,7 @@\n \n #include <libcamera/logging.h>\n \n+#include \"thread.h\"\n #include \"utils.h\"\n \n /**\n@@ -196,7 +197,8 @@ void LogOutput::write(const LogMessage &msg)\n \t\tbreak;\n \tcase LoggingTargetStream:\n \tcase LoggingTargetFile:\n-\t\tstr = \"[\" + utils::time_point_to_string(msg.timestamp()) + \"]\"\n+\t\tstr = \"[\" + utils::time_point_to_string(msg.timestamp()) + \"] [\"\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",
        "2/2"
    ]
}