diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-01-22 11:55:59 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-01-22 16:05:29 +0100 |
commit | fc9f622cba6b6671f5b5f0371de9bf31ae75c7d1 (patch) | |
tree | c28e4d52ede9302c14412d636ce97d7ef55b9436 /src/buildtool/common/repository_config.hpp | |
parent | cf7bdda108ef7bfe2efc612725f99946dc30c774 (diff) | |
download | justbuild-fc9f622cba6b6671f5b5f0371de9bf31ae75c7d1.tar.gz |
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.
Diffstat (limited to 'src/buildtool/common/repository_config.hpp')
-rw-r--r-- | src/buildtool/common/repository_config.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<std::string> { - 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<std::string> { + return git_cas_ ? git_cas_->ReadObject( + hex_id, /*is_hex_id=*/true, log_failure) : std::nullopt; } |