Find LoggerFactory.getLogger calls inside loops

Proprietary

LoggerFactory.getLogger(...) resolves the logger through the SLF4J binding on every call. Hoist the logger to a private val companion property — there's exactly one logger per class.

org.openrewrite.kotlin.performance.FindLoggerFactoryGetLoggerInLoops$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.performance.FindLoggerFactoryGetLoggerInLoops$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.