From fc9f622cba6b6671f5b5f0371de9bf31ae75c7d1 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 22 Jan 2025 11:55:59 +0100 Subject: Git CAS access: reduce log level Trying to access a git object return a recoverable failure, hence the failure to find the object in the git object database should be logged at warning level at most. Moreover, in some cases we should log that event at an even lower level, e.g., if we're just checking the presence of the object in the local git cas to avoid unnecessary network access. --- src/buildtool/file_system/git_cas.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/buildtool/file_system/git_cas.hpp') diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp index f63fd543..5c5a3f31 100644 --- a/src/buildtool/file_system/git_cas.hpp +++ b/src/buildtool/file_system/git_cas.hpp @@ -63,9 +63,13 @@ class GitCAS { } /// \brief Read object from CAS. - /// \param id The object id. - /// \param is_hex_id Specify whether `id` is hex string or raw. - [[nodiscard]] auto ReadObject(std::string const& id, bool is_hex_id = false) + /// \param id The object id. + /// \param is_hex_id Specify whether `id` is hex string or raw. + /// \param log_failure Log level at which to log failures accessing the + /// object. + [[nodiscard]] auto ReadObject(std::string const& id, + bool is_hex_id = false, + LogLevel log_failure = LogLevel::Warning) const noexcept -> std::optional; /// \brief Read object header from CAS. -- cgit v1.2.3