{"id":22715,"url":"https://patchwork.libcamera.org/api/patches/22715/?format=json","web_url":"https://patchwork.libcamera.org/patch/22715/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250130195811.1230581-7-pobrn@protonmail.com>","date":"2025-01-30T19:58:47","name":"[RFC,v2,6/9] libcamera: base: log: Pass dynamic prefix through","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4d06ba0595af13e0980719c4a39a36da4556c388","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/?format=json","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22715/mbox/","series":[{"id":4982,"url":"https://patchwork.libcamera.org/api/series/4982/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4982","date":"2025-01-30T19:58:14","name":"libcamera: base: log: Misc. changes","version":2,"mbox":"https://patchwork.libcamera.org/series/4982/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22715/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22715/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 52A1BBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jan 2025 19:58:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 15B7C68574;\n\tThu, 30 Jan 2025 20:58:55 +0100 (CET)","from mail-10631.protonmail.ch (mail-10631.protonmail.ch\n\t[79.135.106.31])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C7406851B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jan 2025 20:58:53 +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=\"qFNEtj3p\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1738267132; x=1738526332;\n\tbh=wWWSvTBWzUt3mMvSNWgsAgb9RJeXwkMcnIay0f3fFDw=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=qFNEtj3pFXJbE81nfEv0YwdU3zrbHZkQivw2L/Ga/0yUwmXZuw/j9l0fj42H041hN\n\tEWxXyMElGbmjkKLeP7meTox7jAOCJPZDBTsS1jZVPchOgBfKw/uoz9uqQ4+2Vt8eLl\n\tS5QLh3CZWqsWu8iKIKJnD9phE6dUtW2vHK1QNvn7rCBTu3ct0lnFfEIVzaPZuFpqFa\n\tbH8/AwvZgtXpFNyFNzzP/mj5Qfkxg/qWY9UnQemwJ9qg9XeereWfKwjSZg25ScQhU/\n\tdLBbRKG9N2S17CWOPmfNMAqg7dLwgcmQ9ZIkNEBDyKxBu7ksbwvWnHdnkkFlzYIceF\n\tHH/OYZRIxPbrA==","Date":"Thu, 30 Jan 2025 19:58:47 +0000","To":"libcamera-devel@lists.libcamera.org","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[RFC PATCH v2 6/9] libcamera: base: log: Pass dynamic prefix through","Message-ID":"<20250130195811.1230581-7-pobrn@protonmail.com>","In-Reply-To":"<20250130195811.1230581-1-pobrn@protonmail.com>","References":"<20250130195811.1230581-1-pobrn@protonmail.com>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"f7c5cdebdb8bce63116dffcb783b8c597c6fea9e","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":"Use move construction to essentially pass through the string\nreturned by `Loggable::logPrefix()` to avoid an unnecessary copy.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/log.h | 2 +-\n src/libcamera/base/log.cpp   | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)","diff":"diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\nindex acef24203..1fb92603f 100644\n--- a/include/libcamera/base/log.h\n+++ b/include/libcamera/base/log.h\n@@ -64,7 +64,7 @@ class LogMessage\n public:\n \tLogMessage(const char *fileName, unsigned int line,\n \t\t   const LogCategory &category, LogSeverity severity,\n-\t\t   const std::string &prefix = std::string());\n+\t\t   std::string prefix = {});\n \t~LogMessage();\n \n \tstd::ostream &stream() { return msgStream_; }\ndiff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 9415b6937..0dfdb0e9b 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -872,9 +872,9 @@ const LogCategory &LogCategory::defaultCategory()\n  */\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\t       std::string prefix)\n \t: category_(category), severity_(severity),\n-\t  timestamp_(utils::clock::now()), prefix_(prefix)\n+\t  timestamp_(utils::clock::now()), prefix_(std::move(prefix))\n {\n \tstd::ostringstream ossFileInfo;\n \tossFileInfo << utils::basename(fileName) << \":\" << line;\n","prefixes":["RFC","v2","6/9"]}