From d156302b055a8c1595a4c96d40ee8adbc94fce77 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 14 Mar 2024 17:07:50 +0100 Subject: WriteTargetCacheEntries: Be explicit in logging location... ...by allowing a Logger instance to be provided. Also adds a flag in order for failed artifacts from builds orchestrated by the serve endpoint to be able to be reported as errors instead of warnings. --- src/buildtool/main/build_utils.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/buildtool/main/build_utils.hpp') diff --git a/src/buildtool/main/build_utils.hpp b/src/buildtool/main/build_utils.hpp index cf1c68ec..e86e2a90 100644 --- a/src/buildtool/main/build_utils.hpp +++ b/src/buildtool/main/build_utils.hpp @@ -30,6 +30,7 @@ #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" +#include "src/buildtool/logging/logger.hpp" #include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/buildtool/storage/target_cache.hpp" @@ -79,6 +80,8 @@ static const std::function return x.ToString(); }; +/// \brief Write the target cache entries resulting after a build. +/// \param strict_logging Bump warnings to actual errors. void WriteTargetCacheEntries( std::unordered_map const& cache_targets, std::unordered_map const& @@ -87,7 +90,9 @@ void WriteTargetCacheEntries( gsl::not_null const& local_api, gsl::not_null const& remote_api, TargetCacheWriteStrategy strategy = TargetCacheWriteStrategy::Sync, - TargetCache const& tc = Storage::Instance().TargetCache()); + TargetCache const& tc = Storage::Instance().TargetCache(), + Logger const* logger = nullptr, + bool strict_logging = false); #endif // BOOTSTRAP_BUILD_TOOL #endif // INCLUDED_SRC_BUILDOOL_MAIN_BUILD_UTILS_HPP -- cgit v1.2.3