From 4dcf66d4d00ca0b718e2b8c1ec8f56f1c0910a09 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 29 Oct 2024 17:08:23 +0100 Subject: Graph traverser: fix wrong wording in trace-level message As we write the first message about the actual upload of a blob, we should use future rather than past tense. Also, again at trace level, add a message of successful completion, if we succeeded. --- src/buildtool/graph_traverser/graph_traverser.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/buildtool/graph_traverser/graph_traverser.hpp b/src/buildtool/graph_traverser/graph_traverser.hpp index 17ec1b7a..4821e604 100644 --- a/src/buildtool/graph_traverser/graph_traverser.hpp +++ b/src/buildtool/graph_traverser/graph_traverser.hpp @@ -285,7 +285,7 @@ class GraphTraverser { context_.apis->hash_function, blob); Logger::Log(logger_, LogLevel::Trace, [&]() { return fmt::format( - "Uploaded blob {}, its digest has id {} and size {}.", + "Will upload blob {}, its digest has id {} and size {}.", nlohmann::json(blob).dump(), digest.hash(), digest.size()); @@ -305,7 +305,16 @@ class GraphTraverser { } } // Upload remaining blobs. - return context_.apis->remote->Upload(std::move(container)); + auto result = context_.apis->remote->Upload(std::move(container)); + Logger::Log(logger_, LogLevel::Trace, [&]() { + std::stringstream msg{}; + msg << (result ? "Finished" : "Failed") << " upload of\n"; + for (auto const& blob : blobs) { + msg << " - " << nlohmann::json(blob).dump() << "\n"; + } + return msg.str(); + }); + return result; } /// \brief Adds the artifacts to be retrieved to the graph -- cgit v1.2.3