Obtain a plugin's logger from Logging.getLogger

MSAL

Replace project.getLogger() in a Plugin with a private static final Logger obtained from Logging.getLogger(TheClass.class). A logger taken from the project is attributed to the build rather than to the plugin, so its output carries nothing to say where it came from, and reaching through the project for it is one more use of the project to remove before build logic can be configuration-cache safe. A logger the class already declares that way is used as it is, rather than a second one being added. A task's own getLogger() is left alone: Gradle attributes that one to the task already. See the Gradle best practice.

org.openrewrite.gradle.migrate.logging.UseLoggingGetLogger
mod run . --recipe=org.openrewrite.gradle.migrate.logging.UseLoggingGetLogger

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.