Replace JUL Level arguments with the corresponding method calls
Recipe ID
org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipesArtifact
org.openrewrite.recipe:rewrite-logging-frameworksReplace calls to Logger.log(Level, String) with the corresponding method calls.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipesIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-logging-frameworks:3.31.0Definition
This recipe runs the following recipes in order.
- Replace JUL
Logger.log(Level.FINEST, String)withLogger.finest(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinestToMethodRecipe - Replace JUL
Logger.log(Level.FINEST, Supplier<String>)withLogger.finest(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinestSupplierToMethodRecipe - Replace JUL
Logger.log(Level.FINER, String)withLogger.finer(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinerToMethodRecipe - Replace JUL
Logger.log(Level.FINER, Supplier<String>)withLogger.finer(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinerSupplierToMethodRecipe - Replace JUL
Logger.log(Level.FINE, String)withLogger.fine(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFineToMethodRecipe - Replace JUL
Logger.log(Level.FINE, Supplier<String>)withLogger.fine(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFineSupplierToMethodRecipe - Replace JUL
Logger.log(Level.INFO, String)withLogger.info(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelInfoToMethodRecipe - Replace JUL
Logger.log(Level.INFO, Supplier<String>)withLogger.info(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelInfoSupplierToMethodRecipe - Replace JUL
Logger.log(Level.WARNING, String)withLogger.warning(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelWarningToMethodRecipe - Replace JUL
Logger.log(Level.WARNING, Supplier<String>)withLogger.warning(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelWarningSupplierToMethodRecipe - Replace JUL
Logger.log(Level.SEVERE, String)withLogger.severe(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelSevereToMethodRecipe - Replace JUL
Logger.log(Level.SEVERE, Supplier<String>)withLogger.severe(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelSevereSupplierToMethodRecipe - Replace JUL
Logger.log(Level.CONFIG, String)withLogger.config(String)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelConfigToMethodRecipe - Replace JUL
Logger.log(Level.CONFIG, Supplier<String>)withLogger.config(Supplier<String>)org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelConfigSupplierToMethodRecipe
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats