Show a patch.

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

{
    "id": 3860,
    "url": "https://patchwork.libcamera.org/api/patches/3860/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3860/",
    "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": "<20200526142237.407557-2-jacopo@jmondi.org>",
    "date": "2020-05-26T14:22:30",
    "name": "[libcamera-devel,1/8] android: camera_device: Provide log prefix",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a312ab322ca706ea79af64bef38c58aadab12358",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3860/mbox/",
    "series": [
        {
            "id": 930,
            "url": "https://patchwork.libcamera.org/api/series/930/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=930",
            "date": "2020-05-26T14:22:29",
            "name": "android: Implament format translation",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/930/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3860/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3860/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA68F60E08\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 May 2020 16:19:24 +0200 (CEST)",
            "from localhost.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7999D4000B;\n\tTue, 26 May 2020 14:19:24 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 26 May 2020 16:22:30 +0200",
        "Message-Id": "<20200526142237.407557-2-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20200526142237.407557-1-jacopo@jmondi.org>",
        "References": "<20200526142237.407557-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 1/8] android: camera_device: Provide log\n\tprefix",
        "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": "Tue, 26 May 2020 14:19:25 -0000"
    },
    "content": "Make the CameraDevice a Loggable subclass and provide a logPrefix()\nmethod to identify which camera the log outout refers to.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 5 +++++\n src/android/camera_device.h   | 6 +++++-\n 2 files changed, 10 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 4ec429fc3f8f..ad277cb059ca 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -863,6 +863,11 @@ void CameraDevice::requestComplete(Request *request)\n \tdelete buffer;\n }\n \n+std::string CameraDevice::logPrefix() const\n+{\n+\treturn \"'\" + camera_->name() + \"'\";\n+}\n+\n void CameraDevice::notifyShutter(uint32_t frameNumber, uint64_t timestamp)\n {\n \tcamera3_notify_msg_t notify = {};\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex bce1cfbc85a4..350408c1a3e4 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -16,11 +16,12 @@\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n \n+#include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/message.h\"\n \n class CameraMetadata;\n \n-class CameraDevice\n+class CameraDevice : protected libcamera::Loggable\n {\n public:\n \tCameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera);\n@@ -39,6 +40,9 @@ public:\n \tint processCaptureRequest(camera3_capture_request_t *request);\n \tvoid requestComplete(libcamera::Request *request);\n \n+protected:\n+\tstd::string logPrefix() const;\n+\n private:\n \tstruct Camera3RequestDescriptor {\n \t\tCamera3RequestDescriptor(unsigned int frameNumber,\n",
    "prefixes": [
        "libcamera-devel",
        "1/8"
    ]
}