Build: output build time for tasks with --info

To minimize the amount of output during project build, to make it more
comfortable to work with the project in the terminal.
This commit is contained in:
Alexander Udalov
2021-01-12 14:33:39 +01:00
parent 07ce991b3f
commit cc90ff78fd
+3 -3
View File
@@ -94,14 +94,14 @@ private class BuildTimeReporter(
val totalTimeSec = totalTimeNs.toDouble() / secondInNs
if (totalTimeSec < 1) return
log.warn("Build time for tasks:")
log.info("Build time for tasks:")
for (category in TaskCategory.values()) {
val timeNs = categoryTimeNs[category] ?: 0L
val timeSec = timeNs.toDouble() / secondInNs
if (timeSec < 1) continue
val percent = timeSec / totalTimeSec * 100
log.warn("${category.description()}: ${timeSec.asShortString()}s (${percent.asShortString()}% of total time)")
log.info("${category.description()}: ${timeSec.asShortString()}s (${percent.asShortString()}% of total time)")
}
}
}
}