From patchwork Wed Apr 29 00:28:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3606 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 58C6F603F9 for ; Wed, 29 Apr 2020 02:28:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RSMgg8Mq"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C5125521 for ; Wed, 29 Apr 2020 02:28:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588120118; bh=qONyBi27O9ZtCTDtb5vr1kmVpdiAXHE94QbN6wpXg/o=; h=From:To:Subject:Date:From; b=RSMgg8Mq4hbvkW1hrcjER2nHJW0OHTfDE/lTsCkxohwTfQYAVCIG2wKYdl6IPxULs UbH7sj831AUzrLg2DSu4hHQXQCndCR316OPXahOdHquB/G6FboAiz6+zqB86rkqdvK AL3eIsoYpsMD8Z494VpCJqfFu4ukd1qIHwufzVQQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 29 Apr 2020 03:28:35 +0300 Message-Id: <20200429002835.29597-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: ipa_module: Add log prefix 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: , X-List-Received-Date: Wed, 29 Apr 2020 00:28:39 -0000 Make the IPAModule class inherit from Loggable to log the IPA module name in all messages. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/include/ipa_module.h | 6 +++++- src/libcamera/ipa_module.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h index a9a3511701d4..15022e19edce 100644 --- a/src/libcamera/include/ipa_module.h +++ b/src/libcamera/include/ipa_module.h @@ -14,11 +14,12 @@ #include #include +#include "log.h" #include "pipeline_handler.h" namespace libcamera { -class IPAModule +class IPAModule : public Loggable { public: explicit IPAModule(const std::string &libPath); @@ -37,6 +38,9 @@ public: bool match(PipelineHandler *pipe, uint32_t minVersion, uint32_t maxVersion) const; +protected: + std::string logPrefix() const override; + private: struct IPAModuleInfo info_; std::vector signature_; diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 52823e88a508..3444a788b855 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -471,4 +471,9 @@ bool IPAModule::match(PipelineHandler *pipe, !strcmp(info_.pipelineName, pipe->name()); } +std::string IPAModule::logPrefix() const +{ + return utils::basename(libPath_.c_str()); +} + } /* namespace libcamera */