Skip to content

Commit

Permalink
Kotlin: Log our verbosity level
Browse files Browse the repository at this point in the history
This happens at `info` level, which is logged by default.
  • Loading branch information
igfoo committed Oct 11, 2024
1 parent f1a350c commit 156ddd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class KotlinExtractorExtension(
val logger = Logger(loggerBase, tw)
logger.info("Extraction started")
logger.flush()
logger.infoVerbosity()
logger.info("Extraction for invocation TRAP file $invocationTrapFile")
logger.flush()
logger.info("Kotlin version ${KotlinCompilerVersion.getVersion()}")
Expand Down
8 changes: 8 additions & 0 deletions java/kotlin-extractor/src/main/kotlin/utils/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ open class LoggerBase(val logCounter: LogCounter) {
}
}

fun infoVerbosity(dtw: DiagnosticTrapWriter) {
info(dtw, "Kotlin extractor verbosity is " + verbosity.toString())
}

fun warn(dtw: DiagnosticTrapWriter, msg: String, extraInfo: String?) {
if (verbosity >= 2) {
diagnostic(dtw, Severity.Warn, msg, extraInfo)
Expand Down Expand Up @@ -301,6 +305,10 @@ open class Logger(val loggerBase: LoggerBase, val dtw: DiagnosticTrapWriter) {
loggerBase.info(dtw, msg)
}

fun infoVerbosity() {
loggerBase.infoVerbosity(dtw)
}

private fun warn(msg: String, extraInfo: String?) {
loggerBase.warn(dtw, msg, extraInfo)
}
Expand Down

0 comments on commit 156ddd3

Please sign in to comment.