Parameterize SLF4J's logging statements

MSAL

Use SLF4J's parameterized logging, which can significantly boost performance for messages that otherwise would be assembled with String concatenation. Particularly impactful when the log level is not enabled, as no work is done to assemble the message.

org.openrewrite.java.logging.slf4j.ParameterizedLogging
mod run . --recipe=org.openrewrite.java.logging.slf4j.ParameterizedLogging

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. Parameterize logging statements org.slf4j.Logger trace(..)
  2. Parameterize logging statements org.slf4j.Logger debug(..)
  3. Parameterize logging statements org.slf4j.Logger info(..)
  4. Parameterize logging statements org.slf4j.Logger warn(..)
  5. Parameterize logging statements org.slf4j.Logger error(..)