diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-11 13:00:30 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-11 14:29:33 +0100 |
commit | 877c810528a05015f59caebc2f9999dbed670f15 (patch) | |
tree | b4fd118703680d1bcce5f87f889604e1ee750bfe /src/buildtool/file_system/git_cas.hpp | |
parent | bb3d8e8e4451211331afa81cc7754a9d65c12e3e (diff) | |
download | justbuild-877c810528a05015f59caebc2f9999dbed670f15.tar.gz |
GitCAS::Open: allow specifying the log-level for failure
This method returns a GitCASPtr allowing the caller to handle
failure gracefully. Therefore, logging should be at most at level
Warning as it is up to the caller to provide the fatal error message.
Moreover, it can be at lower level in cases where failure to open
that git cas is not an unexpected event, e.g., when looking for a
blob in local mirrors first.
Diffstat (limited to 'src/buildtool/file_system/git_cas.hpp')
-rw-r--r-- | src/buildtool/file_system/git_cas.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp index 0b104f54..f63fd543 100644 --- a/src/buildtool/file_system/git_cas.hpp +++ b/src/buildtool/file_system/git_cas.hpp @@ -25,6 +25,7 @@ #include "gsl/gsl" #include "src/buildtool/file_system/git_utils.hpp" #include "src/buildtool/file_system/object_type.hpp" +#include "src/buildtool/logging/log_level.hpp" class GitCAS; using GitCASPtr = std::shared_ptr<GitCAS const>; @@ -33,7 +34,8 @@ using GitCASPtr = std::shared_ptr<GitCAS const>; class GitCAS { public: [[nodiscard]] static auto Open( - std::filesystem::path const& repo_path) noexcept -> GitCASPtr; + std::filesystem::path const& repo_path, + LogLevel log_failure = LogLevel::Warning) noexcept -> GitCASPtr; [[nodiscard]] static auto CreateEmpty() noexcept -> GitCASPtr; |