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/common/repository_config.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/buildtool/common/repository_config.hpp') diff --git a/src/buildtool/common/repository_config.hpp b/src/buildtool/common/repository_config.hpp index 7e9ba88f..61eb4b7c 100644 --- a/src/buildtool/common/repository_config.hpp +++ b/src/buildtool/common/repository_config.hpp @@ -82,9 +82,12 @@ class RepositoryConfig { return nullptr; } - [[nodiscard]] auto ReadBlobFromGitCAS(std::string const& hex_id) - const noexcept -> std::optional { - return git_cas_ ? git_cas_->ReadObject(hex_id, /*is_hex_id=*/true) + [[nodiscard]] auto ReadBlobFromGitCAS( + std::string const& hex_id, + LogLevel log_failure = LogLevel::Warning) const noexcept + -> std::optional { + return git_cas_ ? git_cas_->ReadObject( + hex_id, /*is_hex_id=*/true, log_failure) : std::nullopt; } -- cgit v1.2.3