KE2: Emit truncated diagnostic info

This commit is contained in:
Ian Lynagh
2024-09-09 17:34:41 +01:00
parent 092290c066
commit 186022e89c
2 changed files with 5 additions and 8 deletions

View File

@@ -141,9 +141,9 @@ OLD: KE1
val globalExtensionState = KotlinExtractorGlobalState()
*/
doAnalysis(compression, trapDir, srcDir, loggerBase, dtw, compilation, invocationExtractionProblems, kotlinArgs)
loggerBase.printLimitedDiagnosticCounts(dtw)
/*
OLD: KE1
loggerBase.printLimitedDiagnosticCounts(tw)
logPeakMemoryUsage(logger, "after extractor")
*/
logger.info("Extraction completed")

View File

@@ -278,22 +278,19 @@ class LoggerBase(val diagnosticCounter: DiagnosticCounter): BasicLogger {
}
}
/*
OLD: KE1
fun printLimitedDiagnosticCounts(dtw: DiagnosticTrapWriter) {
for ((caller, info) in diagnosticCounter.diagnosticInfo) {
val severity = info.first
val count = info.second
for ((caller, count) in diagnosticCounter.diagnosticInfo) {
val callDescription = caller.first
val severity = caller.second
if (count >= diagnosticCounter.diagnosticLimit) {
val message =
"Total of $count diagnostics (reached limit of ${diagnosticCounter.diagnosticLimit}) from $caller."
if (verbosity >= 1) {
emitDiagnostic(dtw, severity, "Limit", message, message, null, dtw.unknownLocation)
emitDiagnostic(dtw, null, severity, "Limit", message, message, null, dtw.unknownLocation)
}
}
}
}
*/
override fun flush() {
logStream.flush()