Replace JUL Level arguments with the corresponding method calls

MSAL

Replace calls to Logger.log(Level, String) with the corresponding method calls.

org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes
mod run . --recipe=org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes

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. Replace JUL Logger.log(Level.FINEST, String) with Logger.finest(String)
  2. Replace JUL Logger.log(Level.FINEST, Supplier<String>) with Logger.finest(Supplier<String>)
  3. Replace JUL Logger.log(Level.FINER, String) with Logger.finer(String)
  4. Replace JUL Logger.log(Level.FINER, Supplier<String>) with Logger.finer(Supplier<String>)
  5. Replace JUL Logger.log(Level.FINE, String) with Logger.fine(String)
  6. Replace JUL Logger.log(Level.FINE, Supplier<String>) with Logger.fine(Supplier<String>)
  7. Replace JUL Logger.log(Level.INFO, String) with Logger.info(String)
  8. Replace JUL Logger.log(Level.INFO, Supplier<String>) with Logger.info(Supplier<String>)
  9. Replace JUL Logger.log(Level.WARNING, String) with Logger.warning(String)
  10. Replace JUL Logger.log(Level.WARNING, Supplier<String>) with Logger.warning(Supplier<String>)
  11. Replace JUL Logger.log(Level.SEVERE, String) with Logger.severe(String)
  12. Replace JUL Logger.log(Level.SEVERE, Supplier<String>) with Logger.severe(Supplier<String>)
  13. Replace JUL Logger.log(Level.CONFIG, String) with Logger.config(String)
  14. Replace JUL Logger.log(Level.CONFIG, Supplier<String>) with Logger.config(Supplier<String>)