KE2: More logging

This commit is contained in:
Ian Lynagh
2024-08-23 15:57:19 +01:00
parent f3afedd510
commit f2e47fc09e
2 changed files with 10 additions and 7 deletions

View File

@@ -107,11 +107,11 @@ OLD: KE1
dtw.flush()
val logger = Logger(loggerBase, dtw)
logger.info("Extraction started")
/*
OLD: KE1
logger.flush()
logger.info("Extraction for invocation TRAP file $invocationTrapFile")
logger.flush()
/*
OLD: KE1
logger.info("Kotlin version ${KotlinCompilerVersion.getVersion()}")
logger.flush()
logPeakMemoryUsage(logger, "before extractor")
@@ -138,8 +138,11 @@ OLD: KE1
OLD: KE1
loggerBase.printLimitedDiagnosticCounts(tw)
logPeakMemoryUsage(logger, "after extractor")
*/
logger.info("Extraction completed")
logger.flush()
/*
OLD: KE1
val compilationTimeMs = System.currentTimeMillis() - startTimeMs
tw.writeCompilation_finished(
compilation,
@@ -147,9 +150,9 @@ OLD: KE1
compilationTimeMs.toDouble() / 1000,
invocationExtractionProblems.extractionResult()
)
tw.flush()
loggerBase.close()
*/
dtw.flush()
loggerBase.close()
}
}

View File

@@ -304,6 +304,7 @@ OLD: KE1
}
}
}
*/
fun flush() {
logStream.flush()
@@ -312,20 +313,19 @@ OLD: KE1
fun close() {
logStream.close()
}
*/
}
/**
* Logger is the high-level interface for writint log messages.
*/
open class Logger(val loggerBase: LoggerBase, val dtw: DiagnosticTrapWriter) {
/*
OLD: KE1
fun flush() {
dtw.flush()
loggerBase.flush()
}
/*
OLD: KE1
fun trace(msg: String) {
loggerBase.trace(dtw, msg)
}