0

https://docs.openrewrite.org/recipes/java/logging/systemouttologging

I am trying to apply the follwing recipe on a gradle project, but the recipe doesnt apply changes to my files.

Here is the build.gradle file.

enter image description here Here is my java class,

enter image description here

I am running the gradle using ./gradlew rewriterun. Do I need to specify the options there? Can you please tell me if I miss something.

Not able to see the changes that recipe make.

1 Answers1

0

The recipe is not making any changes, as you are missing a configuration option. Please also see the comment I had posted here two weeks ago: https://github.com/openrewrite/rewrite-logging-frameworks/issues/110#issuecomment-1624308853

There are no required options as per the documentation, but when addLogger is not defined, then no logging statements are inserted it seems. You might want to try again while passing those options in a rewrite.yml file. If that also fails for you, then it might be time to start on a reproduction test.

You might want to add a rewrite.yml file to your project root that passes in the required options.

type: specs.openrewrite.org/v1beta/recipe
name: io.moderne.builder.YourRecipe
displayName: Your recipe
description: Created in the builder at https://app.moderne.io/recipes/builder
recipeList:
  - org.openrewrite.java.logging.SystemOutToLogging:
      addLogger: "True"
      loggingFramework: SLF4J
      level: info
Tim
  • 19,793
  • 8
  • 70
  • 95