[IC] Lower logging level inside RecoverableCompilationTransaction

#KT-49785 In Progress
This commit is contained in:
Alexander Likhachev
2022-11-18 13:47:28 +01:00
committed by Space Team
parent 5461667421
commit 7d471dafa3
@@ -6,9 +6,9 @@
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.build.report.BuildReporter
import org.jetbrains.kotlin.build.report.debug
import org.jetbrains.kotlin.build.report.metrics.BuildTime
import org.jetbrains.kotlin.build.report.metrics.measure
import org.jetbrains.kotlin.build.report.warn
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollector
import org.jetbrains.kotlin.konan.file.use
import java.io.Closeable
@@ -60,7 +60,7 @@ class RecoverableCompilationTransaction(
if (Files.exists(outputFile)) {
stashFile(outputFile)
} else {
reporter.warn { "Marking the $outputFile file as newly added" }
reporter.debug { "Marking the $outputFile file as newly added" }
fileRelocationRegistry[outputFile] = null
}
}
@@ -68,8 +68,8 @@ class RecoverableCompilationTransaction(
override fun deleteFile(outputFile: Path) {
if (fileRelocationIsAlreadyRegisteredFor(outputFile)) {
reporter.warn { "Deleting $outputFile" }
if (Files.exists(outputFile)) {
reporter.debug { "Deleting $outputFile" }
Files.delete(outputFile)
}
return
@@ -81,7 +81,7 @@ class RecoverableCompilationTransaction(
private fun stashFile(outputFile: Path) {
val relocatedFilePath = getNextRelocatedFilePath()
reporter.warn { "Moving $outputFile to the stash as $relocatedFilePath" }
reporter.debug { "Moving $outputFile to the stash as $relocatedFilePath" }
fileRelocationRegistry[outputFile] = relocatedFilePath
Files.move(outputFile, relocatedFilePath)
}
@@ -91,7 +91,7 @@ class RecoverableCompilationTransaction(
private fun fileRelocationIsAlreadyRegisteredFor(outputFile: Path) = outputFile in fileRelocationRegistry
private fun revertChanges() {
reporter.warn { "Reverting changes" }
reporter.debug { "Reverting changes" }
reporter.measure(BuildTime.RESTORE_OUTPUT_FROM_BACKUP) {
for ((originPath, relocatedPath) in fileRelocationRegistry) {
if (relocatedPath == null) {
@@ -106,7 +106,7 @@ class RecoverableCompilationTransaction(
}
private fun cleanupStash() {
reporter.warn { "Cleaning up stash" }
reporter.debug { "Cleaning up stash" }
reporter.measure(BuildTime.CLEAN_BACKUP_STASH) {
Files.walk(stashDir).use {
it.sorted(Comparator.reverseOrder())