Skip to content

Commit

Permalink
Use sonar-api logging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Michal Paluchowski committed Jul 31, 2017
1 parent 8e95e3a commit c4bc399
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.15</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@

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;
import java.io.IOException;

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;

Expand Down Expand Up @@ -85,7 +85,7 @@ private class LogInfoStreamConsumer implements StreamConsumer {

@Override
public void consumeLine(String line) {
log.info(line);
LOGGER.info(line);
}

}
Expand All @@ -94,7 +94,7 @@ private class LogErrorStreamConsumer implements StreamConsumer {

@Override
public void consumeLine(String line) {
log.error(line);
LOGGER.error(line);
}

}
Expand Down

0 comments on commit c4bc399

Please sign in to comment.