[{"id":33490,"web_url":"https://patchwork.libcamera.org/comment/33490/","msgid":"<byi5hoy2kq7gietckxeavhialxjq7wxbppowxztijwhjk5443o@5mgvwceolwsk>","date":"2025-02-26T07:41:43","subject":"Re: [PATCH v4 3/8] libcamera: base: log: Remove `LogMessage::init()`","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Tue, Feb 25, 2025 at 05:35:53PM +0000, Barnabás Pőcze wrote:\n> It is a short function that can be merged into the constructor with\n> essentially no change in observable behaviour, so do that.\n>\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/base/log.h |  2 --\n>  src/libcamera/base/log.cpp   | 16 ++++------------\n>  2 files changed, 4 insertions(+), 14 deletions(-)\n>\n> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n> index b3050eedb..6d2c93019 100644\n> --- a/include/libcamera/base/log.h\n> +++ b/include/libcamera/base/log.h\n> @@ -75,8 +75,6 @@ public:\n>  private:\n>  \tLIBCAMERA_DISABLE_COPY_AND_MOVE(LogMessage)\n>\n> -\tvoid init(const char *fileName, unsigned int line);\n> -\n>  \tstd::ostringstream msgStream_;\n>  \tconst LogCategory &category_;\n>  \tLogSeverity severity_;\n> diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\n> index 42514de97..a43ed9684 100644\n> --- a/src/libcamera/base/log.cpp\n> +++ b/src/libcamera/base/log.cpp\n> @@ -861,19 +861,11 @@ 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()),\n> +\t  fileInfo_((std::ostringstream() << utils::basename(fileName) << \":\" << line).str()),\n\nmeh, matter of tastes\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n> +\t  prefix_(prefix)\n>  {\n> -\tinit(fileName, line);\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> 2.48.1\n>\n>","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 45534BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Feb 2025 07:41:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 586556873D;\n\tWed, 26 Feb 2025 08:41:49 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA2F261852\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Feb 2025 08:41:46 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D89C3497;\n\tWed, 26 Feb 2025 08:40:18 +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=\"o3oWjiDm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740555619;\n\tbh=dOoBLZPUTjgSpEV+taE/QQ3Xfmv4gZ/8zPu67YrWhgk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=o3oWjiDm1ri5+l3YEM2dEgROCwO++iQF6jl0u++pJ69le74Q3YEyTIF4v5d6MWHT6\n\tg+ZheIpn/8E7D6LwhYYcQhzj/4R2Hqobm6os0BpqIophlAV86/u9xKeKQPKL6z3+FW\n\t7cW0iwbvuuj3VHQ9PVvGi03QPZlHgP/lwb+PLDVA=","Date":"Wed, 26 Feb 2025 08:41:43 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v4 3/8] libcamera: base: log: Remove `LogMessage::init()`","Message-ID":"<byi5hoy2kq7gietckxeavhialxjq7wxbppowxztijwhjk5443o@5mgvwceolwsk>","References":"<20250225173531.2595922-1-pobrn@protonmail.com>\n\t<20250225173531.2595922-4-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250225173531.2595922-4-pobrn@protonmail.com>","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>"}}]