In Kotlin KSP, I try to debug the processor
internal class ListedProcessor(
private val fileGenerator: FileWriter,
) : SymbolProcessor {
override fun process(resolver: Resolver): List<KSAnnotated> {
val listedFunctions: Sequence<KSFunctionDeclaration> =
resolver.findAnnotations(Listed::class)
val arrayedFunctions: Sequence<KSFunctionDeclaration> =
resolver.findAnnotations(Arrayed::class)
return (listedFunctions + arrayedFunctions).filterNot { it.validate() }.toList()
}
}
I try to use println
but don't know where the output goes to. How can I dump out log for Kotlin KSP?
As per the conversation in Kotlin Slack, please use the
KSPLogger
to perform logging. For example:You can get a handle on the
KSPLogger
through theenvironment
parameter in thecreate
function of yourSymbolProcessorProvider
: