From bcf986d07b1faf5412304cf63a0dfd05dbd91472 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 29 Apr 2020 03:26:48 +0300 Subject: libcamera: ipa_module: Add log prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the IPAModule class inherit from Loggable to log the IPA module name in all messages. Before: [14:19:55.743795676] [20250] ERROR IPAModule ipa_module.cpp:279 IPA module is not an ELF file After: [14:20:22.343795887] [20270] ERROR IPAModule ipa_module.cpp:279 ipa_vimc.so: IPA module is not an ELF file 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 a9a35117..15022e19 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 52823e88..3444a788 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 */ -- cgit v1.2.1