summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-03-16 11:52:01 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-03-20 11:10:05 +0100
commit8f694cb2f9127ff515500c5eb878bb0dcad2899a (patch)
tree1f7e51044b835694eece79eb33953456a3c101ac /src/buildtool/main/main.cpp
parent86466c946e49d0a501e6616f55b92e913ca535cb (diff)
downloadjustbuild-8f694cb2f9127ff515500c5eb878bb0dcad2899a.tar.gz
just: only report export targets if there are any
By default, messages at level "progress" and above are shown. So, messages at that level should be useful for the user in the typical case. For the count of export targets, this information is only useful if the build involves export targets at all; the absence of export targets is typically only used when debugging the build structure.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 6801f2b2..16385ade 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -1387,12 +1387,19 @@ auto main(int argc, char* argv[]) -> int {
result->id.ToString());
auto const& stat = Statistics::Instance();
- Logger::Log(LogLevel::Info,
- "Export targets found: {} cached, {} uncached, "
- "{} not eligible for caching",
- stat.ExportsCachedCounter(),
- stat.ExportsUncachedCounter(),
- stat.ExportsNotEligibleCounter());
+ {
+ auto cached = stat.ExportsCachedCounter();
+ auto uncached = stat.ExportsUncachedCounter();
+ auto not_eligible = stat.ExportsNotEligibleCounter();
+ Logger::Log(cached + uncached + not_eligible > 0
+ ? LogLevel::Info
+ : LogLevel::Debug,
+ "Export targets found: {} cached, {} uncached, "
+ "{} not eligible for caching",
+ cached,
+ uncached,
+ not_eligible);
+ }
ReportTaintedness(*result);
auto const& [actions, blobs, trees] = result_map.ToResult();