Show a patch.

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

{
    "id": 22585,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/22585/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22585/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250120133038.817550-1-stefan.klug@ideasonboard.com>",
    "date": "2025-01-20T13:30:15",
    "name": "libcamera: log: Match whole category in LIBCAMERA_LOG_LEVELS",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "dcca28a225c503e7b70fd608cc99647b9bd9a1da",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22585/mbox/",
    "series": [
        {
            "id": 4956,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4956/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4956",
            "date": "2025-01-20T13:30:15",
            "name": "libcamera: log: Match whole category in LIBCAMERA_LOG_LEVELS",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4956/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22585/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22585/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 CF544C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jan 2025 13:30:48 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE2DE6854B;\n\tMon, 20 Jan 2025 14:30:47 +0100 (CET)",
            "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 53F3960354\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jan 2025 14:30:46 +0100 (CET)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:4375:4b53:c7c1:47a6])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD6AA2E0;\n\tMon, 20 Jan 2025 14:29:44 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CW/FNviE\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1737379784;\n\tbh=s5lV/uDSLTP+XHBveD+g0XZqof1Qj9O+ihT9clxu4mo=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=CW/FNviEoKzEWDr0Ioag0MwIQ17wQzd/l9y8f2o+Ngfyf91FwEtytMNdxn7R5oUdE\n\tKij7V1GnOXi8TD8ehRF63391ZXbOKZs1JitZ/1PCtYmmQlcv5YZ/XGVDbGBCwr6RMX\n\tE+zTDULYIau1f3K9NHtaTdbA25GVjpqGrg//Mpvk=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH] libcamera: log: Match whole category in LIBCAMERA_LOG_LEVELS",
        "Date": "Mon, 20 Jan 2025 14:30:15 +0100",
        "Message-ID": "<20250120133038.817550-1-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "A LIBCAMERA_LOG_LEVELS value of \"RkISP1:0\" also applies to RkISP1Ccm and\nRkISP1Awb. This behavior is unexpected as it automatically enables all\nalgorithm log categories when the intent is only to increase the log\nlevel of the upper category. Fix that by ensuring that the full name\ngets matched.  The * wildcard is still supported, so RkISP1* matches\nRkISP1 and RkISP1Awb.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/libcamera/base/log.cpp | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 3a656b8f099f..36e57d6017ab 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -718,11 +718,15 @@ void Logger::registerCategory(LogCategory *category)\n \n \tconst std::string &name = category->name();\n \tfor (const std::pair<std::string, LogSeverity> &level : levels_) {\n+\t\tunsigned int i;\n+\t\tbool wildcard = false;\n \t\tbool match = true;\n \n-\t\tfor (unsigned int i = 0; i < level.first.size(); ++i) {\n-\t\t\tif (level.first[i] == '*')\n+\t\tfor (i = 0; i < level.first.size(); ++i) {\n+\t\t\tif (level.first[i] == '*') {\n+\t\t\t\twildcard = true;\n \t\t\t\tbreak;\n+\t\t\t}\n \n \t\t\tif (i >= name.size() ||\n \t\t\t    name[i] != level.first[i]) {\n@@ -731,6 +735,10 @@ void Logger::registerCategory(LogCategory *category)\n \t\t\t}\n \t\t}\n \n+\t\t/* Ensure the full name got matched */\n+\t\tif (!(wildcard || i == name.size()))\n+\t\t\tcontinue;\n+\n \t\tif (match) {\n \t\t\tcategory->setSeverity(level.second);\n \t\t\tbreak;\n",
    "prefixes": []
}