From 50c04b44ca971c4d551b45b265257585805be129 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 23 Aug 2024 12:27:23 +0100 Subject: [PATCH] KE2: Tweak LogCounter; now renamed to DiagnosticCounter --- .../src/main/kotlin/utils/Logger.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/java/kotlin-extractor2/src/main/kotlin/utils/Logger.kt b/java/kotlin-extractor2/src/main/kotlin/utils/Logger.kt index 6b3ab1ea4dd..689dc8cd9d5 100644 --- a/java/kotlin-extractor2/src/main/kotlin/utils/Logger.kt +++ b/java/kotlin-extractor2/src/main/kotlin/utils/Logger.kt @@ -10,9 +10,15 @@ import java.text.SimpleDateFormat import java.util.Date import java.util.Stack import org.jetbrains.kotlin.ir.IrElement +*/ -class LogCounter() { - public val diagnosticInfo = mutableMapOf>() +/** + * Counts the number of times each diagnostic message (based on the + * location of the diagnostic from the stack trace, and its severity) + * has been emitted. + */ +class DiagnosticCounter() { + public val diagnosticInfo = mutableMapOf, Int>() public val diagnosticLimit: Int init { @@ -21,6 +27,9 @@ class LogCounter() { } } +/** + * The severity of a diagnostic message. + */ enum class Severity(val sev: Int) { WarnLow(1), Warn(2), @@ -37,6 +46,8 @@ enum class Severity(val sev: Int) { ErrorGlobal(8) } +/* +OLD: KE1 class LogMessage(private val kind: String, private val message: String) { val timestamp: String