Skip to content

Commit

Permalink
chore: enhance logging for better tracability
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Mar 5, 2020
1 parent e771179 commit f9006f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/groovy/com/github/spotbugs/snom/SpotBugsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SpotBugsPlugin implements Plugin<Project> {
public static final String CONFIG_NAME = "spotbugs";
public static final String PLUGINS_CONFIG_NAME = "spotbugsPlugins";
public static final String SLF4J_CONFIG_NAME = "spotbugsSlf4j";
public static final String EXTENSION_NAME = "spotbugs";

private final Logger log = LoggerFactory.getLogger(SpotBugsPlugin.class);

@Override
public void apply(Project project) {
project.getPluginManager().apply(SpotBugsBasePlugin.class);
Expand All @@ -34,6 +38,7 @@ public void apply(Project project) {

private void createTasks(Project project, SpotBugsExtension extension) {
@Nullable Task check = project.getTasks().findByName("check");
log.debug("check task {}", check == null ? "not found" : "found");
new SpotBugsTaskFactory()
.generate(
project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void generateForJava(Project project, Action<? super SpotBugsTask> confi
.all(
sourceSet -> {
String name = sourceSet.getTaskName("spotbugs", null);
log.debug("Creating SpotBugsTaskForJava for {}", sourceSet);
log.debug("Creating SpotBugsTask for {}", sourceSet);
project
.getTasks()
.create(
Expand Down Expand Up @@ -74,7 +74,7 @@ private void generateForAndroid(
.all(
task -> {
String name = GUtil.toLowerCamelCase("spotbugs " + task.getVariantName());
log.debug("Creating SpotBugsTaskForAndroid for {}", task);
log.debug("Creating SpotBugsTask for {}", task);
project
.getTasks()
.register(
Expand Down

0 comments on commit f9006f1

Please sign in to comment.