Seokjae Lee
06/24/2025, 8:46 AM@Slf4j
annotation’s simplicity. In Kotlin, you either put loggers at the top-level (breaking “one class per file”) or declare them in every single class (lots of boilerplate).
The Solution: Just use <http://log.info|log.info> { }
directly in any class - no declarations needed!
class UserService {
fun createUser() {
<http://log.info|log.info> { "Creating user" } // :sparkles: Works automatically!
}
}
How it works: Uses Kotlin Symbol Processing (KSP) to generate logger extensions at compile-time. Zero runtime overhead, integrates with kotlin-logging, and works with any package depth.
🔗 GitHub: https://github.com/doljae/kotlin-logging-extensions
Still early stage (v0.0.1) but it’s already working well in my projects. Would love to hear your thoughts or feedback if anyone tries it out!
#Kotlin #KSP #Logging #OpenSourceאליהו הדס
06/24/2025, 11:58 AMSeokjae Lee
06/25/2025, 12:39 AMSeokjae Lee
06/25/2025, 9:44 AM