From f2052ea627d1df8d6a427096d4146a70fcb15548 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 3 Apr 2025 15:21:19 +0200 Subject: Result-Map: do not log analysis result in ToFile operation ... to avoid duplicate log entries. --- src/buildtool/build_engine/target_map/result_map.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/buildtool/build_engine/target_map/result_map.hpp b/src/buildtool/build_engine/target_map/result_map.hpp index 9753b9e0..594ee3fe 100644 --- a/src/buildtool/build_engine/target_map/result_map.hpp +++ b/src/buildtool/build_engine/target_map/result_map.hpp @@ -354,9 +354,10 @@ class ResultTargetMap { template [[nodiscard]] auto ToJson(gsl::not_null const& stats, - gsl::not_null const& progress) const + gsl::not_null const& progress, + Logger const* logger = nullptr) const -> nlohmann::json { - auto const result = ToResult(stats, progress); + auto const result = ToResult(stats, progress, logger); auto actions = nlohmann::json::object(); auto trees = nlohmann::json::object(); std::for_each(result.actions.begin(), @@ -385,9 +386,12 @@ class ResultTargetMap { gsl::not_null const& stats, gsl::not_null const& progress, int indent = 2) const -> void { + auto logger = Logger("result-dumping"); + logger.SetLogLimit(LogLevel::Error); if (not destinations.empty()) { // As serialization is expensive, compute the string only once - auto data = ToJson(stats, progress).dump(indent); + auto data = + ToJson(stats, progress, &logger).dump(indent); for (auto const& graph_file : destinations) { Logger::Log(LogLevel::Info, "Dumping action graph to file {}.", -- cgit v1.2.3