From c4bc39938b0ef8f8c6b8e98e197abb6d2d16a67d Mon Sep 17 00:00:00 2001 From: Michal Paluchowski Date: Mon, 31 Jul 2017 12:38:13 +0200 Subject: [PATCH] Use sonar-api logging Removing our own references to logging via SLF4J and using the recommended way of obtaining a logger from the sonar-api. We're always working within the SonarQube context, so we let it provide the logging setup. --- pom.xml | 6 ------ .../sonar/plugin/coldfusion/cflint/CFLintAnalyzer.java | 10 +++++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 30e61e0..9b08d35 100644 --- a/pom.xml +++ b/pom.xml @@ -67,12 +67,6 @@ commons-lang 2.6 - - ch.qos.logback - logback-classic - 0.9.15 - provided - diff --git a/src/main/java/com/stepstone/sonar/plugin/coldfusion/cflint/CFLintAnalyzer.java b/src/main/java/com/stepstone/sonar/plugin/coldfusion/cflint/CFLintAnalyzer.java index 14a36fc..a730150 100644 --- a/src/main/java/com/stepstone/sonar/plugin/coldfusion/cflint/CFLintAnalyzer.java +++ b/src/main/java/com/stepstone/sonar/plugin/coldfusion/cflint/CFLintAnalyzer.java @@ -18,14 +18,14 @@ import com.google.common.base.Preconditions; import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.config.Settings; import org.sonar.api.utils.command.Command; import org.sonar.api.utils.command.CommandExecutor; import org.sonar.api.utils.command.StreamConsumer; +import org.sonar.api.utils.log.Logger; +import org.sonar.api.utils.log.Loggers; import javax.xml.stream.XMLStreamException; import java.io.File; @@ -33,7 +33,7 @@ public class CFLintAnalyzer { - private final Logger log = LoggerFactory.getLogger(CFLintAnalyzer.class); + private final Logger LOGGER = Loggers.get(CFLintAnalyzer.class); private final Settings settings; private final FileSystem fs; @@ -85,7 +85,7 @@ private class LogInfoStreamConsumer implements StreamConsumer { @Override public void consumeLine(String line) { - log.info(line); + LOGGER.info(line); } } @@ -94,7 +94,7 @@ private class LogErrorStreamConsumer implements StreamConsumer { @Override public void consumeLine(String line) { - log.error(line); + LOGGER.error(line); } }