From fca9ce75d5cb6d90edab84aec5fdfea7af7d8b59 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 31 Oct 2023 16:08:45 +0100 Subject: DistdirCheckout: Improve log messages --- src/other_tools/repo_map/repos_to_setup_map.cpp | 30 +++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/other_tools/repo_map/repos_to_setup_map.cpp b/src/other_tools/repo_map/repos_to_setup_map.cpp index d0396a0c..4c1b80ad 100644 --- a/src/other_tools/repo_map/repos_to_setup_map.cpp +++ b/src/other_tools/repo_map/repos_to_setup_map.cpp @@ -471,30 +471,36 @@ void DistdirCheckout(ExpressionPtr const& repo_desc, // check mandatory fields auto repo_desc_content = (*resolved_repo_desc)->At("content"); if (not repo_desc_content) { - (*logger)( - "DistdirCheckout: Mandatory field \"content\" is " - "missing", - /*fatal=*/true); + (*logger)(fmt::format( + "DistdirCheckout: Mandatory field \"content\" is " + "missing for repository {}", + nlohmann::json(dist_repo_name).dump()), + /*fatal=*/true); return; } if (not repo_desc_content->get()->IsString()) { (*logger)(fmt::format("DistdirCheckout: Unsupported value {} " - "for mandatory field \"content\"", - repo_desc_content->get()->ToString()), + "for mandatory field \"content\" for " + "repository {}", + repo_desc_content->get()->ToString(), + nlohmann::json(dist_repo_name).dump()), /*fatal=*/true); return; } auto repo_desc_fetch = (*resolved_repo_desc)->At("fetch"); if (not repo_desc_fetch) { - (*logger)( - "DistdirCheckout: Mandatory field \"fetch\" is missing", - /*fatal=*/true); + (*logger)(fmt::format("DistdirCheckout: Mandatory field " + "\"fetch\" is missing for repository {}", + nlohmann::json(dist_repo_name).dump()), + /*fatal=*/true); return; } if (not repo_desc_fetch->get()->IsString()) { - (*logger)(fmt::format("DistdirCheckout: Unsupported value {} " - "for mandatory field \"fetch\"", - repo_desc_fetch->get()->ToString()), + (*logger)(fmt::format( + "DistdirCheckout: Unsupported value {} " + "for mandatory field \"fetch\" for repository {}", + repo_desc_fetch->get()->ToString(), + nlohmann::json(dist_repo_name).dump()), /*fatal=*/true); return; } -- cgit v1.2.3