Show a patch.

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

{
    "id": 22604,
    "url": "https://patchwork.libcamera.org/api/patches/22604/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22604/",
    "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": "<20250121185554.301901-1-pobrn@protonmail.com>",
    "date": "2025-01-21T18:55:56",
    "name": "[RFC,v1,3/7] libcamera: base: log: Remove `LogMessage::init()`",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9f300bbfc12ffac851da85cab3cd2634309af4d7",
    "submitter": {
        "id": 133,
        "url": "https://patchwork.libcamera.org/api/people/133/?format=api",
        "name": "Pőcze Barnabás",
        "email": "pobrn@protonmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22604/mbox/",
    "series": [
        {
            "id": 4960,
            "url": "https://patchwork.libcamera.org/api/series/4960/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4960",
            "date": "2025-01-21T18:50:47",
            "name": "libcamera: base: log: Misc. changes",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4960/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22604/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22604/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 8D3B5BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jan 2025 18:56:07 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3B0A68503;\n\tTue, 21 Jan 2025 19:56:06 +0100 (CET)",
            "from mail-40131.protonmail.ch (mail-40131.protonmail.ch\n\t[185.70.40.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DD1860380\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jan 2025 19:56:04 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"TJxPIzIa\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1737485763; x=1737744963;\n\tbh=inYsCoT9BMm1Qo17lhRjtpTS9yz04iQOJCGsmUDqf+g=;\n\th=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:\n\tSubject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector:\n\tList-Unsubscribe:List-Unsubscribe-Post;\n\tb=TJxPIzIa5w5578ZByJWJ34edO5Oai6TQtSZINB3/frn4X6pvNHbhQrd8xQ/PtDjJn\n\tMmT/7lFzmr9+pHVBHsdj5CqlCBBjHrr6ik0aBuNfjSAuCgDm7Z3ddVn8uSetQcJRZX\n\tWIOmuDNrcroOaz0OqR9XU2cm7gHBa1+Hn3AMHKNO/j14V9uez0r2SCHyqXLB4gbW5I\n\tAH90vqpf/buocljFlO7W51TE3Y2UopZasFVCB9ihSV658M2E9fqKQ+gcn3U+Jz2wI/\n\tZ0hQ9TbDp6pgvko9fRHavuDR5gGJGBEoXJiWU0J8EmLW7q5IGQSg69LRknBrvggTrf\n\t46xNPmvG3wRCQ==",
        "Date": "Tue, 21 Jan 2025 18:55:56 +0000",
        "To": "libcamera-devel@lists.libcamera.org",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>",
        "Subject": "[RFC PATCH v1 3/7] libcamera: base: log: Remove `LogMessage::init()`",
        "Message-ID": "<20250121185554.301901-1-pobrn@protonmail.com>",
        "Feedback-ID": "20568564:user:proton",
        "X-Pm-Message-ID": "d93e837d6a92c0de7f7a3d770ff826e6bece2bf7",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=utf-8",
        "Content-Transfer-Encoding": "quoted-printable",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "It is a short function that can be merged into the constructor with\nessentially no change in observable behaviour, so do that.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n---\n include/libcamera/base/log.h |  2 --\n src/libcamera/base/log.cpp   | 17 +++++------------\n 2 files changed, 5 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\nindex 620930125..d73aa7913 100644\n--- a/include/libcamera/base/log.h\n+++ b/include/libcamera/base/log.h\n@@ -77,8 +77,6 @@ public:\n private:\n \tLIBCAMERA_DISABLE_COPY(LogMessage)\n \n-\tvoid init(const char *fileName, unsigned int line);\n-\n \tstd::ostringstream msgStream_;\n \tconst LogCategory &category_;\n \tLogSeverity severity_;\ndiff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 1024fed7f..1513e41fb 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -876,9 +876,12 @@ const LogCategory &LogCategory::defaultCategory()\n LogMessage::LogMessage(const char *fileName, unsigned int line,\n \t\t       const LogCategory &category, LogSeverity severity,\n \t\t       const std::string &prefix)\n-\t: category_(category), severity_(severity), prefix_(prefix)\n+\t: category_(category), severity_(severity),\n+\t  timestamp_(utils::clock::now()), prefix_(prefix)\n {\n-\tinit(fileName, line);\n+\tstd::ostringstream ossFileInfo;\n+\tossFileInfo << utils::basename(fileName) << \":\" << line;\n+\tfileInfo_ = std::move(ossFileInfo).str();\n }\n \n /**\n@@ -901,16 +904,6 @@ LogMessage::LogMessage(LogMessage &&other)\n {\n }\n \n-void LogMessage::init(const char *fileName, unsigned int line)\n-{\n-\t/* Log the timestamp, severity and file information. */\n-\ttimestamp_ = utils::clock::now();\n-\n-\tstd::ostringstream ossFileInfo;\n-\tossFileInfo << utils::basename(fileName) << \":\" << line;\n-\tfileInfo_ = ossFileInfo.str();\n-}\n-\n LogMessage::~LogMessage()\n {\n \t/* Don't print anything if we have been moved to another LogMessage. */\n",
    "prefixes": [
        "RFC",
        "v1",
        "3/7"
    ]
}