Is it possible to use Lombok with Kotlin?

ps-aux :

I have a Kotlin Gradle project. I added Lombok as a dependency and also registred it with kapt

compileOnly("org.projectlombok:lombok:$lombokVersion")
kapt("org.projectlombok:lombok:$lombokVersion")

I would like to use just @Slf4j anotation for automatic log generation. It works for Java classes but not for the Kotlin ones.

Is using Kotling and Lombok together even possible as of now ?

EDIT: Adding more details

If I annotate a Kotlin classs with @Slf4j and use log inside it I get

Unresolved reference: log

Evidently no annotation processing is applied.

Sahil Chhabra :

You cannot use annotation @Slf4j, but manually create its object in the class required.

Refer https://www.reddit.com/r/Kotlin/comments/8gbiul/slf4j_loggers_in_3_ways/

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=421850&siteId=1