dev.datlag.sekret.Logger.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler-plugin Show documentation
Show all versions of compiler-plugin Show documentation
Compiler plugin for sekret annotations
The newest version!
package dev.datlag.sekret
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.messages.toLogger
data class Logger(
val debug: Boolean,
val messageCollector: MessageCollector
) {
fun log(message: String) {
messageCollector.report(CompilerMessageSeverity.INFO, message)
messageCollector.toLogger().log(message)
}
fun warn(message: String) {
messageCollector.report(CompilerMessageSeverity.WARNING, message)
messageCollector.toLogger().warning(message)
}
}