[{"id":4656,"web_url":"https://patchwork.libcamera.org/comment/4656/","msgid":"<20200430005140.GB1752267@oden.dyn.berto.se>","date":"2020-04-30T00:51:40","subject":"Re: [libcamera-devel] [PATCH] libcamera: ipa_module: Add log prefix","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-04-29 03:28:35 +0300, Laurent Pinchart wrote:\n> Make the IPAModule class inherit from Loggable to log the IPA module\n> name in all messages.\n\nIt would be nice with a pre and post example of how the new log-line \nlooks in the commit message.\n\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nWith or without updated commit message,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/ipa_module.h | 6 +++++-\n>  src/libcamera/ipa_module.cpp       | 5 +++++\n>  2 files changed, 10 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h\n> index a9a3511701d4..15022e19edce 100644\n> --- a/src/libcamera/include/ipa_module.h\n> +++ b/src/libcamera/include/ipa_module.h\n> @@ -14,11 +14,12 @@\n>  #include <ipa/ipa_interface.h>\n>  #include <ipa/ipa_module_info.h>\n>  \n> +#include \"log.h\"\n>  #include \"pipeline_handler.h\"\n>  \n>  namespace libcamera {\n>  \n> -class IPAModule\n> +class IPAModule : public Loggable\n>  {\n>  public:\n>  \texplicit IPAModule(const std::string &libPath);\n> @@ -37,6 +38,9 @@ public:\n>  \tbool match(PipelineHandler *pipe,\n>  \t\t   uint32_t minVersion, uint32_t maxVersion) const;\n>  \n> +protected:\n> +\tstd::string logPrefix() const override;\n> +\n>  private:\n>  \tstruct IPAModuleInfo info_;\n>  \tstd::vector<uint8_t> signature_;\n> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\n> index 52823e88a508..3444a788b855 100644\n> --- a/src/libcamera/ipa_module.cpp\n> +++ b/src/libcamera/ipa_module.cpp\n> @@ -471,4 +471,9 @@ bool IPAModule::match(PipelineHandler *pipe,\n>  \t       !strcmp(info_.pipelineName, pipe->name());\n>  }\n>  \n> +std::string IPAModule::logPrefix() const\n> +{\n> +\treturn utils::basename(libPath_.c_str());\n> +}\n> +\n>  } /* namespace libcamera */\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0412A6041C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Apr 2020 02:51:42 +0200 (CEST)","by mail-lf1-x142.google.com with SMTP id l11so3311660lfc.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Apr 2020 17:51:41 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\to18sm3659062lfb.13.2020.04.29.17.51.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 29 Apr 2020 17:51:40 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"VAnroS3O\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=PnDCxqTqyAOne9tpJapf574HcLOJ4qBfSqUIWXC14TQ=;\n\tb=VAnroS3OtDPFwnQUF9j1FpivJFJkmE4gquXuJtcrjMrcF5s62JI75jYe3cNsv0uUcN\n\tA/cBcGI7vasMtA5ha0WTlVz57lGJOUDopjd6vmodhdtItzj3ERR3RTNeP01N2rhyCK/l\n\tiWG7P+/TIi46G6xIT416vi+73k+JweNb4D4Mz/kd2Uw3PMOLsmkG9gFniHSofjJcNgqe\n\tQOIxRX5RWqxqf6DU1YSXN3X81ytrRqhqW85DEUmuAik1YewBM7JK/Z415yJUOLnZYnDL\n\t97Gb01lovNFt0iJQb5I2cGyq+uR9VQbXVpHsxhi9/s4V5LMz6EaDb9M5lcFr/hGv7bwT\n\tAJhQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=PnDCxqTqyAOne9tpJapf574HcLOJ4qBfSqUIWXC14TQ=;\n\tb=N69z3vZWe3QWtVRQ3XvW3/J4cYjyzYa0+SqXkIG4PAf1+x9AiRh/VrkDypHNUpx5b/\n\tpGOIIVJdM7uYXV9KWyTn36FJ4Rvg83yogIv5VdbiVre+nQ6FXKgqA8b60yQlLmjMoZ/A\n\ttUWZ3qBsDB+kGfCcinGa8CYoyaCpDeuKiaAfKnFRbfBkUPcFMOJMLoVQDVg+A+F7p9+b\n\tRVzCM1QgRDuK9PH47v/a9BeT048IKWlwet4QJ4FMQirqLBPpCnVn4B1gvjIMKiMuEM0h\n\tzu2z7cpCY1Y883wttLbT3Aku4Xu/XpGf60VKtJEu4rAGndr+m2LIy7LZLsWnHUi7ocbY\n\th3BA==","X-Gm-Message-State":"AGi0PuaOvthyCOjPtNUdcIuEkKsdWFqJyF5mBpDzNj46ZKsMUXpMUaaC\n\t52rBng9eTi1RNVtEnV8+fL1CFQ==","X-Google-Smtp-Source":"APiQypLQp5SPLriibcBLJLt4ygWp5BhoEhxOrDoLjlTACGL7P9t9RgJXsM6J6kNHwQ3ZbNyDtmua4w==","X-Received":"by 2002:ac2:5684:: with SMTP id 4mr329417lfr.88.1588207901376;\n\tWed, 29 Apr 2020 17:51:41 -0700 (PDT)","Date":"Thu, 30 Apr 2020 02:51:40 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200430005140.GB1752267@oden.dyn.berto.se>","References":"<20200429002835.29597-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200429002835.29597-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [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":"<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>","X-List-Received-Date":"Thu, 30 Apr 2020 00:51:42 -0000"}}]