Find redundant logger level-check guards

Proprietary

Bundles if (log.isXxxEnabled) ... finders. With kotlin-logging's lambda form or SLF4J's {} placeholder form, the level check is built into the call.

org.openrewrite.kotlin.logging.FindLoggerGuards$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.logging.FindLoggerGuards$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.

Recipe list

It runs these recipes, in this order.

  1. Find if (log.isTraceEnabled) ... guards
  2. Find if (log.isDebugEnabled) ... guards
  3. Find if (log.isInfoEnabled) ... guards
  4. Find if (log.isWarnEnabled) ... guards
  5. Find if (log.isErrorEnabled) ... guards