From patchwork Mon Jan 19 11:31:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 25848 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7AC47BDCBF for ; Mon, 19 Jan 2026 11:31:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 117D261FD0; Mon, 19 Jan 2026 12:31:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="LhgDa2Rl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EBFC61FBC for ; Mon, 19 Jan 2026 12:31:08 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E3DF52D9 for ; Mon, 19 Jan 2026 12:30:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768822238; bh=dz+PKmSwfBLDv660zSPoeRZk0ATInnynAE8KmASQLBs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LhgDa2RlNzVnI2ZDcYn4BBDpnYvDFguxA2JI71L1WHWFu5RVUIMvnGnZGb5IH1fZP 9qiGN42qPjAFg86z8/vL5E5TJRrpEzUIIb73VxO+pbjl8SjXBG/0mynML3rhwYawui h/YnQc1xWWYNgsr+yH3PPP9NS1Nnjol3D2pK2iMo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 3/5] libcamera: base: log: Do not check severity before printing Date: Mon, 19 Jan 2026 12:31:01 +0100 Message-ID: <20260119113104.3560802-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260119113104.3560802-1-barnabas.pocze@ideasonboard.com> References: <20260119113104.3560802-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that the severity of the log message and the category is compared in the expansion of the `LOG()` macro, there is no need to do it again in the destructor. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- src/libcamera/base/log.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index 6e6d2887c..da45b0d65 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -867,8 +867,7 @@ LogMessage::~LogMessage() msgStream_ << std::endl; - if (severity_ >= category_.severity()) - logger->write(*this); + logger->write(*this); if (severity_ == LogSeverity::LogFatal) { logger->backtrace();