diff options
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner')
49 files changed, 145 insertions, 145 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalServerSettingsProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalServerSettingsProvider.java index b877a9f1815..ebe96be7911 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalServerSettingsProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalServerSettingsProvider.java @@ -22,13 +22,13 @@ package org.sonar.scanner.bootstrap; import java.util.Map; import java.util.Optional; import org.sonar.api.CoreProperties; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.repository.settings.GlobalSettingsLoader; import org.springframework.context.annotation.Bean; public class GlobalServerSettingsProvider { - private static final Logger LOG = Loggers.get(GlobalServerSettingsProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(GlobalServerSettingsProvider.class); @Bean("GlobalServerSettings") public GlobalServerSettings provide(GlobalSettingsLoader loader) { diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java index e2125d8af69..8caa029f93b 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java @@ -24,8 +24,8 @@ import org.sonar.api.CoreProperties; import org.sonar.api.impl.utils.DefaultTempFolder; import org.sonar.api.utils.System2; import org.sonar.api.utils.TempFolder; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.sonar.core.util.FileUtils.deleteQuietly; import org.springframework.context.annotation.Bean; @@ -38,7 +38,7 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.concurrent.TimeUnit; public class GlobalTempFolderProvider { - private static final Logger LOG = Loggers.get(GlobalTempFolderProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(GlobalTempFolderProvider.class); private static final long CLEAN_MAX_AGE = TimeUnit.DAYS.toMillis(21); static final String TMP_NAME_PREFIX = ".sonartmp_"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginFiles.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginFiles.java index 17d6a622193..adc0c01247f 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginFiles.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginFiles.java @@ -31,8 +31,8 @@ import java.util.stream.Stream; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.FileUtils; import org.sonar.api.config.Configuration; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.bootstrap.ScannerPluginInstaller.InstalledPlugin; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.HttpException; @@ -42,7 +42,7 @@ import static java.lang.String.format; public class PluginFiles { - private static final Logger LOGGER = Loggers.get(PluginFiles.class); + private static final Logger LOGGER = LoggerFactory.getLogger(PluginFiles.class); private static final String MD5_HEADER = "Sonar-MD5"; private final DefaultScannerWsClient wsClient; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginRepository.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginRepository.java index b46c2d2acd9..e96eb0889f4 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginRepository.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginRepository.java @@ -26,8 +26,8 @@ import java.util.stream.Collectors; import javax.annotation.CheckForNull; import org.sonar.api.Plugin; import org.sonar.api.Startable; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.platform.ExplodedPlugin; import org.sonar.core.platform.PluginClassLoader; import org.sonar.core.platform.PluginInfo; @@ -42,7 +42,7 @@ import static org.sonar.api.utils.Preconditions.checkState; * Orchestrates the installation and loading of plugins */ public class ScannerPluginRepository implements PluginRepository, Startable { - private static final Logger LOG = Loggers.get(ScannerPluginRepository.class); + private static final Logger LOG = LoggerFactory.getLogger(ScannerPluginRepository.class); private final PluginInstaller installer; private final PluginJarExploder pluginJarExploder; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java index 8269ac8b113..b26017a0ff6 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java @@ -34,8 +34,8 @@ import org.sonar.api.utils.MessageException; import org.sonar.api.utils.System2; import org.sonar.api.utils.UriReader; import org.sonar.api.utils.Version; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.documentation.DefaultDocumentationLinkGenerator; import org.sonar.core.extension.CoreExtensionRepositoryImpl; import org.sonar.core.extension.CoreExtensionsLoader; @@ -58,7 +58,7 @@ import org.sonar.scanner.scan.SpringProjectScanContainer; @Priority(3) public class SpringGlobalContainer extends SpringComponentContainer { - private static final Logger LOG = Loggers.get(SpringGlobalContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(SpringGlobalContainer.class); private final Map<String, String> scannerProperties; private SpringGlobalContainer(Map<String, String> scannerProperties, List<?> addedExternally) { diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/CiConfigurationProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/CiConfigurationProvider.java index 72af3137d7a..03a211e4f2a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/CiConfigurationProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/CiConfigurationProvider.java @@ -25,13 +25,13 @@ import java.util.Optional; import java.util.stream.Collectors; import org.sonar.api.config.Configuration; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; public class CiConfigurationProvider { - private static final Logger LOG = Loggers.get(CiConfigurationProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(CiConfigurationProvider.class); private static final String PROP_DISABLED = "sonar.ci.autoconfig.disabled"; @Bean("CiConfiguration") diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CirrusCi.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CirrusCi.java index 61083f9f394..5d8e2a1a302 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CirrusCi.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CirrusCi.java @@ -20,7 +20,7 @@ package org.sonar.scanner.ci.vendors; import org.sonar.api.utils.System2; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.scanner.ci.CiConfiguration; import org.sonar.scanner.ci.CiConfigurationImpl; import org.sonar.scanner.ci.CiVendor; @@ -55,7 +55,7 @@ public class CirrusCi implements CiVendor { public CiConfiguration loadConfiguration() { String revision = system.envVariable(PROPERTY_COMMIT); if (isEmpty(revision)) { - Loggers.get(getClass()).warn("Missing environment variable " + PROPERTY_COMMIT); + LoggerFactory.getLogger(getClass()).warn("Missing environment variable " + PROPERTY_COMMIT); } return new CiConfigurationImpl(revision, getName()); } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CodeMagic.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CodeMagic.java index 3a864fd9858..1ceb823a01b 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CodeMagic.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CodeMagic.java @@ -20,8 +20,8 @@ package org.sonar.scanner.ci.vendors; import org.sonar.api.utils.System2; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.ci.CiConfiguration; import org.sonar.scanner.ci.CiConfigurationImpl; import org.sonar.scanner.ci.CiVendor; @@ -30,7 +30,7 @@ import static org.apache.commons.lang.StringUtils.isEmpty; public class CodeMagic implements CiVendor { - private static final Logger LOG = Loggers.get(CodeMagic.class); + private static final Logger LOG = LoggerFactory.getLogger(CodeMagic.class); private final System2 system; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/GithubActions.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/GithubActions.java index ae2cb0825d0..d68cf713200 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/GithubActions.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/GithubActions.java @@ -21,7 +21,7 @@ package org.sonar.scanner.ci.vendors; import org.apache.commons.lang.StringUtils; import org.sonar.api.utils.System2; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.scanner.ci.CiConfiguration; import org.sonar.scanner.ci.CiConfigurationImpl; import org.sonar.scanner.ci.CiVendor; @@ -57,7 +57,7 @@ public class GithubActions implements CiVendor { public CiConfiguration loadConfiguration() { String revision = system.envVariable(PROPERTY_COMMIT); if (isEmpty(revision)) { - Loggers.get(getClass()).warn("Missing environment variable " + PROPERTY_COMMIT); + LoggerFactory.getLogger(getClass()).warn("Missing environment variable " + PROPERTY_COMMIT); } return new CiConfigurationImpl(revision, getName()); } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/Jenkins.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/Jenkins.java index 03aa798a6f1..0f53ae29d1d 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/Jenkins.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/Jenkins.java @@ -28,8 +28,8 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryBuilder; import org.sonar.api.batch.fs.internal.DefaultInputProject; import org.sonar.api.utils.System2; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.ci.CiConfiguration; import org.sonar.scanner.ci.CiConfigurationImpl; import org.sonar.scanner.ci.CiVendor; @@ -37,7 +37,7 @@ import org.sonar.scanner.ci.CiVendor; import static org.apache.commons.lang.StringUtils.isNotBlank; public class Jenkins implements CiVendor { - private static final Logger LOG = Loggers.get(Jenkins.class); + private static final Logger LOG = LoggerFactory.getLogger(Jenkins.class); private final System2 system; private final DefaultInputProject inputProject; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/config/DefaultConfiguration.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/config/DefaultConfiguration.java index 2855c44034b..a238807189e 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/config/DefaultConfiguration.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/config/DefaultConfiguration.java @@ -29,8 +29,8 @@ import org.sonar.api.config.Configuration; import org.sonar.api.config.internal.Encryption; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.config.PropertyDefinitions; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.util.Objects.requireNonNull; import static org.apache.commons.lang.StringUtils.trim; @@ -39,7 +39,7 @@ import static org.sonar.api.config.internal.MultivalueProperty.parseAsCsv; @Immutable public abstract class DefaultConfiguration implements Configuration { - private static final Logger LOG = Loggers.get(DefaultConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultConfiguration.class); private final PropertyDefinitions definitions; private final Encryption encryption; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java index e64b8a757e3..9e02a22be0a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/CpdExecutor.java @@ -36,8 +36,8 @@ import javax.inject.Inject; import org.sonar.api.batch.fs.InputComponent; import org.sonar.api.batch.fs.internal.DefaultInputComponent; import org.sonar.api.batch.fs.internal.DefaultInputFile; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.duplications.block.Block; import org.sonar.duplications.detector.suffixtree.SuffixTreeCloneDetectionAlgorithm; import org.sonar.duplications.index.CloneGroup; @@ -57,7 +57,7 @@ import org.sonar.scanner.util.ProgressReport; * The sensors are responsible for handling exclusions and block sizes. */ public class CpdExecutor { - private static final Logger LOG = Loggers.get(CpdExecutor.class); + private static final Logger LOG = LoggerFactory.getLogger(CpdExecutor.class); // timeout for the computation of duplicates in a file (seconds) private static final int TIMEOUT = 5 * 60 * 1000; static final int MAX_CLONE_GROUP_PER_FILE = 100; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/index/SonarCpdBlockIndex.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/index/SonarCpdBlockIndex.java index f6df5a21208..46d56962acc 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/index/SonarCpdBlockIndex.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/cpd/index/SonarCpdBlockIndex.java @@ -25,8 +25,8 @@ import java.util.Iterator; import java.util.Set; import java.util.stream.Collectors; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.duplications.block.Block; import org.sonar.duplications.block.ByteArray; import org.sonar.duplications.index.AbstractCloneIndex; @@ -40,7 +40,7 @@ import org.sonar.scanner.protocol.output.ScannerReport; import org.sonar.scanner.report.ReportPublisher; public class SonarCpdBlockIndex extends AbstractCloneIndex { - private static final Logger LOG = Loggers.get(SonarCpdBlockIndex.class); + private static final Logger LOG = LoggerFactory.getLogger(SonarCpdBlockIndex.class); private final CloneIndex mem = new PackedMemoryCloneIndex(); private final ReportPublisher publisher; // Files already tokenized diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java index 468c2fdec1a..00eeb9a3a8a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java @@ -30,14 +30,14 @@ import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.issue.NewExternalIssue; import org.sonar.api.batch.sensor.issue.NewIssueLocation; import org.sonar.api.rules.RuleType; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.externalissue.ReportParser.Issue; import org.sonar.scanner.externalissue.ReportParser.Location; import org.sonar.scanner.externalissue.ReportParser.Report; public class ExternalIssueImporter { - private static final Logger LOG = Loggers.get(ExternalIssueImporter.class); + private static final Logger LOG = LoggerFactory.getLogger(ExternalIssueImporter.class); private static final int MAX_UNKNOWN_FILE_PATHS_TO_PRINT = 5; private final SensorContext context; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssuesImportSensor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssuesImportSensor.java index 6d698e98605..508523a4527 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssuesImportSensor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssuesImportSensor.java @@ -32,12 +32,12 @@ import org.sonar.api.batch.sensor.SensorDescriptor; import org.sonar.api.config.Configuration; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.externalissue.ReportParser.Report; public class ExternalIssuesImportSensor implements Sensor { - private static final Logger LOG = Loggers.get(ExternalIssuesImportSensor.class); + private static final Logger LOG = LoggerFactory.getLogger(ExternalIssuesImportSensor.class); static final String REPORT_PATHS_PROPERTY_KEY = "sonar.externalIssuesReportPaths"; private final Configuration config; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/DefaultSarif210Importer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/DefaultSarif210Importer.java index 09888ee5199..57fcfee61a9 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/DefaultSarif210Importer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/DefaultSarif210Importer.java @@ -24,8 +24,8 @@ import java.util.Set; import javax.annotation.CheckForNull; import org.sonar.api.batch.sensor.issue.NewExternalIssue; import org.sonar.api.scanner.ScannerSide; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.sarif.Run; import org.sonar.core.sarif.Sarif210; @@ -33,7 +33,7 @@ import static java.util.Objects.requireNonNull; @ScannerSide public class DefaultSarif210Importer implements Sarif210Importer { - private static final Logger LOG = Loggers.get(DefaultSarif210Importer.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultSarif210Importer.class); private final RunMapper runMapper; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RulesSeverityDetector.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RulesSeverityDetector.java index d02744371b7..10141fd8215 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RulesSeverityDetector.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RulesSeverityDetector.java @@ -27,8 +27,8 @@ import java.util.Set; import java.util.function.Predicate; import javax.annotation.Nullable; import org.sonar.api.batch.rule.Severity; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.sarif.DefaultConfiguration; import org.sonar.core.sarif.Extension; import org.sonar.core.sarif.Result; @@ -43,7 +43,7 @@ import static java.util.stream.Collectors.toMap; import static org.sonar.scanner.externalissue.sarif.ResultMapper.DEFAULT_SEVERITY; public class RulesSeverityDetector { - private static final Logger LOG = Loggers.get(RulesSeverityDetector.class); + private static final Logger LOG = LoggerFactory.getLogger(RulesSeverityDetector.class); public static final String UNSUPPORTED_RULE_SEVERITIES_WARNING = "Unable to detect rules severity for issue detected by tool %s, falling back to default rule severity: %s"; private RulesSeverityDetector() {} diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RunMapper.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RunMapper.java index ded11070476..6131daa1763 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RunMapper.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/sarif/RunMapper.java @@ -25,8 +25,8 @@ import java.util.Optional; import javax.annotation.Nullable; import org.sonar.api.batch.sensor.issue.NewExternalIssue; import org.sonar.api.scanner.ScannerSide; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.sarif.Driver; import org.sonar.core.sarif.Result; import org.sonar.core.sarif.Run; @@ -38,7 +38,7 @@ import static org.sonar.api.utils.Preconditions.checkArgument; @ScannerSide public class RunMapper { - private static final Logger LOG = Loggers.get(RunMapper.class); + private static final Logger LOG = LoggerFactory.getLogger(RunMapper.class); private final ResultMapper resultMapper; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageReportParser.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageReportParser.java index df8865a1b37..73f0593f508 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageReportParser.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageReportParser.java @@ -33,11 +33,11 @@ import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.coverage.NewCoverage; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GenericCoverageReportParser { - private static final Logger LOG = Loggers.get(GenericCoverageReportParser.class); + private static final Logger LOG = LoggerFactory.getLogger(GenericCoverageReportParser.class); private static final String LINE_NUMBER_ATTR = "lineNumber"; private static final String COVERED_ATTR = "covered"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageSensor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageSensor.java index be570858d15..64aa830b0e1 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageSensor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericCoverageSensor.java @@ -31,15 +31,15 @@ import org.sonar.api.batch.sensor.SensorDescriptor; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; import org.sonar.api.scanner.sensor.ProjectSensor; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.config.DefaultConfiguration; import static org.sonar.api.CoreProperties.CATEGORY_CODE_COVERAGE; public class GenericCoverageSensor implements ProjectSensor { - private static final Logger LOG = Loggers.get(GenericCoverageSensor.class); + private static final Logger LOG = LoggerFactory.getLogger(GenericCoverageSensor.class); static final String REPORT_PATHS_PROPERTY_KEY = "sonar.coverageReportPaths"; private final DefaultConfiguration config; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionReportParser.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionReportParser.java index e60e3a015da..49bcd2da928 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionReportParser.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionReportParser.java @@ -32,8 +32,8 @@ import org.codehaus.staxmate.in.SMInputCursor; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.deprecated.test.DefaultTestCase; import org.sonar.scanner.deprecated.test.DefaultTestCase.Status; import org.sonar.scanner.deprecated.test.DefaultTestPlan; @@ -50,7 +50,7 @@ public class GenericTestExecutionReportParser { private static final String OLD_ROOT_ELEMENT = "unitTest"; - private static final Logger LOG = Loggers.get(GenericTestExecutionReportParser.class); + private static final Logger LOG = LoggerFactory.getLogger(GenericTestExecutionReportParser.class); private static final String NAME_ATTR = "name"; private static final String DURATION_ATTR = "duration"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionSensor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionSensor.java index 4d19f0f6411..dfd90fdf66a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionSensor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/GenericTestExecutionSensor.java @@ -28,8 +28,8 @@ import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.SensorDescriptor; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.config.DefaultConfiguration; import org.sonar.scanner.deprecated.test.TestPlanBuilder; @@ -37,7 +37,7 @@ import static org.sonar.api.CoreProperties.CATEGORY_CODE_COVERAGE; public class GenericTestExecutionSensor implements Sensor { - private static final Logger LOG = Loggers.get(GenericTestExecutionSensor.class); + private static final Logger LOG = LoggerFactory.getLogger(GenericTestExecutionSensor.class); static final String REPORT_PATHS_PROPERTY_KEY = "sonar.testExecutionReportPaths"; /** diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/EnforceIssuesFilter.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/EnforceIssuesFilter.java index afce2b62936..82a29265899 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/EnforceIssuesFilter.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/EnforceIssuesFilter.java @@ -31,15 +31,15 @@ import org.sonar.api.rule.RuleKey; import org.sonar.api.scan.issue.filter.FilterableIssue; import org.sonar.api.scan.issue.filter.IssueFilter; import org.sonar.api.scan.issue.filter.IssueFilterChain; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.issue.DefaultFilterableIssue; import org.sonar.scanner.issue.ignore.pattern.IssueInclusionPatternInitializer; import org.sonar.scanner.issue.ignore.pattern.IssuePattern; @ThreadSafe public class EnforceIssuesFilter implements IssueFilter { - private static final Logger LOG = Loggers.get(EnforceIssuesFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(EnforceIssuesFilter.class); private final List<IssuePattern> multicriteriaPatterns; private final AnalysisWarnings analysisWarnings; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/IgnoreIssuesFilter.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/IgnoreIssuesFilter.java index 663fe727197..37e00d1db68 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/IgnoreIssuesFilter.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/IgnoreIssuesFilter.java @@ -35,17 +35,17 @@ import org.sonar.api.scan.issue.filter.FilterableIssue; import org.sonar.api.scan.issue.filter.IssueFilter; import org.sonar.api.scan.issue.filter.IssueFilterChain; import org.sonar.api.utils.WildcardPattern; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.issue.DefaultFilterableIssue; public class IgnoreIssuesFilter implements IssueFilter { + private static final Logger LOG = LoggerFactory.getLogger(IgnoreIssuesFilter.class); private final DefaultActiveRules activeRules; private final AnalysisWarnings analysisWarnings; private final Map<InputComponent, List<WildcardPattern>> rulePatternByComponent = new HashMap<>(); private final Set<RuleKey> warnedDeprecatedRuleKeys = new LinkedHashSet<>(); - private static final Logger LOG = Loggers.get(IgnoreIssuesFilter.class); public IgnoreIssuesFilter(DefaultActiveRules activeRules, AnalysisWarnings analysisWarnings) { this.activeRules = activeRules; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsLoader.java index a770753fe03..0c87eb58066 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsLoader.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsLoader.java @@ -24,8 +24,8 @@ import java.util.List; import javax.annotation.CheckForNull; import org.apache.commons.lang.StringUtils; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.batch.fs.internal.charhandler.CharHandler; import org.sonar.scanner.issue.ignore.IgnoreIssuesFilter; @@ -34,7 +34,7 @@ import org.sonar.scanner.issue.ignore.pattern.IssueExclusionPatternInitializer; import org.sonar.scanner.issue.ignore.pattern.IssuePattern; public final class IssueExclusionsLoader { - private static final Logger LOG = Loggers.get(IssueExclusionsLoader.class); + private static final Logger LOG = LoggerFactory.getLogger(IssueExclusionsLoader.class); private final List<java.util.regex.Pattern> allFilePatterns; private final List<DoubleRegexpMatcher> blockMatchers; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScanner.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScanner.java index 0ae7733c307..5f2b993cf89 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScanner.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScanner.java @@ -25,15 +25,15 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.batch.fs.internal.charhandler.CharHandler; import org.sonar.scanner.issue.ignore.pattern.LineRange; import org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader.DoubleRegexpMatcher; public class IssueExclusionsRegexpScanner extends CharHandler { - private static final Logger LOG = Loggers.get(IssueExclusionsLoader.class); + private static final Logger LOG = LoggerFactory.getLogger(IssueExclusionsRegexpScanner.class); private final StringBuilder sb = new StringBuilder(); private final List<Pattern> allFilePatterns; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/qualitygate/QualityGateCheck.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/qualitygate/QualityGateCheck.java index 94a07481852..2f9fdd3267c 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/qualitygate/QualityGateCheck.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/qualitygate/QualityGateCheck.java @@ -25,8 +25,8 @@ import java.time.temporal.ChronoUnit; import java.util.EnumSet; import org.sonar.api.Startable; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.bootstrap.DefaultScannerWsClient; import org.sonar.scanner.bootstrap.GlobalAnalysisMode; import org.sonar.scanner.report.CeTaskReportDataHolder; @@ -42,7 +42,7 @@ import org.sonarqube.ws.client.WsResponse; public class QualityGateCheck implements Startable { - private static final Logger LOG = Loggers.get(QualityGateCheck.class); + private static final Logger LOG = LoggerFactory.getLogger(QualityGateCheck.class); private static final EnumSet<TaskStatus> TASK_TERMINAL_STATUSES = EnumSet.of(TaskStatus.SUCCESS, TaskStatus.FAILED, TaskStatus.CANCELED); private static final int POLLING_INTERVAL_IN_MS = 5000; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/MetadataPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/MetadataPublisher.java index 6ee1fb5b289..88932df8f99 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/MetadataPublisher.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/MetadataPublisher.java @@ -25,8 +25,8 @@ import java.util.Map.Entry; import java.util.regex.Pattern; import org.sonar.api.batch.fs.internal.AbstractProjectOrModule; import org.sonar.api.batch.scm.ScmProvider; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.ProjectInfo; import org.sonar.scanner.bootstrap.ScannerPlugin; import org.sonar.scanner.bootstrap.ScannerPluginRepository; @@ -45,7 +45,7 @@ import org.sonar.scanner.scm.ScmRevision; public class MetadataPublisher implements ReportPublisherStep { - private static final Logger LOG = Loggers.get(MetadataPublisher.class); + private static final Logger LOG = LoggerFactory.getLogger(MetadataPublisher.class); private final QualityProfiles qProfiles; private final ProjectInfo projectInfo; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java index 8d9d88d29c3..de28e7957a5 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java @@ -40,8 +40,8 @@ import org.sonar.api.platform.Server; import org.sonar.api.utils.MessageException; import org.sonar.api.utils.TempFolder; import org.sonar.api.utils.ZipUtils; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.bootstrap.DefaultScannerWsClient; import org.sonar.scanner.bootstrap.GlobalAnalysisMode; import org.sonar.scanner.fs.InputModuleHierarchy; @@ -66,7 +66,7 @@ import static org.sonar.core.util.FileUtils.humanReadableByteCountSI; import static org.sonar.scanner.scan.branch.BranchType.PULL_REQUEST; public class ReportPublisher implements Startable { - private static final Logger LOG = Loggers.get(ReportPublisher.class); + private static final Logger LOG = LoggerFactory.getLogger(ReportPublisher.class); private static final String CHARACTERISTIC = "characteristic"; private static final String DASHBOARD = "dashboard"; private static final String BRANCH = "branch"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DeprecatedPropertiesWarningGenerator.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DeprecatedPropertiesWarningGenerator.java index 0a2b46d7a57..248bdf716bd 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DeprecatedPropertiesWarningGenerator.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DeprecatedPropertiesWarningGenerator.java @@ -25,13 +25,13 @@ import org.apache.commons.lang.StringUtils; import org.sonar.api.CoreProperties; import org.sonar.api.config.Configuration; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.batch.bootstrapper.EnvironmentInformation; import org.sonar.scanner.bootstrap.ScannerWsClientProvider; public class DeprecatedPropertiesWarningGenerator { - private static final Logger LOG = Loggers.get(DeprecatedPropertiesWarningGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(DeprecatedPropertiesWarningGenerator.class); @VisibleForTesting static final String PASSWORD_WARN_MESSAGE = String.format("The properties '%s' and '%s' are deprecated and will be removed in the " + diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputModuleHierarchyProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputModuleHierarchyProvider.java index 347f7faab30..e634dac4cf3 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputModuleHierarchyProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputModuleHierarchyProvider.java @@ -25,14 +25,14 @@ import java.util.Map; import org.sonar.api.batch.bootstrap.ProjectDefinition; import org.sonar.api.batch.fs.internal.DefaultInputModule; import org.sonar.api.batch.fs.internal.DefaultInputProject; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.scan.filesystem.ScannerComponentIdGenerator; import org.springframework.context.annotation.Bean; public class InputModuleHierarchyProvider { - private static final Logger LOG = Loggers.get(InputModuleHierarchyProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(InputModuleHierarchyProvider.class); @Bean("DefaultInputModuleHierarchy") public DefaultInputModuleHierarchy provide(ScannerComponentIdGenerator scannerComponentIdGenerator, WorkDirectoriesInitializer workDirectoriesInit, DefaultInputProject project) { diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputProjectProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputProjectProvider.java index 2df97afdb17..50e89502d91 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputProjectProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/InputProjectProvider.java @@ -22,13 +22,13 @@ package org.sonar.scanner.scan; import java.util.Locale; import org.sonar.api.batch.bootstrap.ProjectReactor; import org.sonar.api.batch.fs.internal.DefaultInputProject; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.scan.filesystem.ScannerComponentIdGenerator; import org.springframework.context.annotation.Bean; public class InputProjectProvider { - private static final Logger LOG = Loggers.get(InputProjectProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(InputProjectProvider.class); @Bean("DefaultInputProject") public DefaultInputProject provide(ProjectBuildersExecutor projectBuildersExecutor, ProjectReactorValidator validator, diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java index c807b7781f3..3a5d05f6f3a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java @@ -23,14 +23,14 @@ import java.util.Map; import org.apache.commons.lang.StringUtils; import org.sonar.api.CoreProperties; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.repository.settings.ProjectSettingsLoader; import org.springframework.context.annotation.Bean; public class ProjectServerSettingsProvider { - private static final Logger LOG = Loggers.get(ProjectServerSettingsProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(ProjectServerSettingsProvider.class); private static final String MODULE_LEVEL_ARCHIVED_SETTINGS_WARNING = "Settings that were previously configured at " + "sub-project level are not used anymore. Transition the settings listed in ‘General Settings -> General -> " + diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java index 0dc9d6adce5..9cb9d8b509d 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java @@ -29,8 +29,8 @@ import org.sonar.api.batch.sensor.issue.internal.DefaultNoSonarFilter; import org.sonar.api.resources.ResourceTypes; import org.sonar.api.scan.filesystem.PathResolver; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.config.ScannerProperties; import org.sonar.core.extension.CoreExtensionsInstaller; import org.sonar.core.language.LanguagesProvider; @@ -145,7 +145,7 @@ import static org.sonar.scanner.bootstrap.ExtensionUtils.isScannerSide; @Priority(2) public class SpringProjectScanContainer extends SpringComponentContainer { - private static final Logger LOG = Loggers.get(SpringProjectScanContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(SpringProjectScanContainer.class); public SpringProjectScanContainer(SpringComponentContainer globalContainer) { super(globalContainer); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractCoverageAndDuplicationExclusions.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractCoverageAndDuplicationExclusions.java index 879dc99942d..0f059dbc2cf 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractCoverageAndDuplicationExclusions.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractCoverageAndDuplicationExclusions.java @@ -26,15 +26,15 @@ import java.util.stream.Stream; import javax.annotation.concurrent.Immutable; import org.sonar.api.CoreProperties; import org.sonar.api.utils.WildcardPattern; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.batch.fs.internal.DefaultInputFile; import static java.util.stream.Collectors.toList; @Immutable public abstract class AbstractCoverageAndDuplicationExclusions { - private static final Logger LOG = Loggers.get(AbstractCoverageAndDuplicationExclusions.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractCoverageAndDuplicationExclusions.class); private final Function<DefaultInputFile, String> pathExtractor; private final String[] coverageExclusionConfig; private final String[] duplicationExclusionConfig; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractExclusionFilters.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractExclusionFilters.java index b5ade4c59ed..febec2f183b 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractExclusionFilters.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractExclusionFilters.java @@ -30,8 +30,8 @@ import org.sonar.api.CoreProperties; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.fs.internal.PathPattern; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.String.format; import static org.sonar.api.CoreProperties.PROJECT_TESTS_EXCLUSIONS_PROPERTY; @@ -41,7 +41,7 @@ import static org.sonar.api.CoreProperties.PROJECT_TEST_INCLUSIONS_PROPERTY; public abstract class AbstractExclusionFilters { - private static final Logger LOG = Loggers.get(AbstractExclusionFilters.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractExclusionFilters.class); private static final String WARNING_ALIAS_PROPERTY_USAGE = "Use of %s detected. While being taken into account, the only supported property is %s." + " Consider updating your configuration."; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/FileIndexer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/FileIndexer.java index 2d177d4edee..4d9b8c2a377 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/FileIndexer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/FileIndexer.java @@ -39,8 +39,8 @@ import org.sonar.api.batch.fs.internal.SensorStrategy; import org.sonar.api.batch.scm.IgnoreCommand; import org.sonar.api.notifications.AnalysisWarnings; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader; import org.sonar.scanner.repository.language.Language; import org.sonar.scanner.scan.ScanProperties; @@ -54,7 +54,7 @@ import static java.lang.String.format; */ public class FileIndexer { - private static final Logger LOG = Loggers.get(FileIndexer.class); + private static final Logger LOG = LoggerFactory.getLogger(FileIndexer.class); private final AnalysisWarnings analysisWarnings; private final ScanProperties properties; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/MetadataGenerator.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/MetadataGenerator.java index 562fcbe338a..3581d24d0b2 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/MetadataGenerator.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/MetadataGenerator.java @@ -25,12 +25,12 @@ import org.sonar.api.batch.fs.InputFile.Type; import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.batch.fs.internal.FileMetadata; import org.sonar.api.batch.fs.internal.Metadata; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader; public class MetadataGenerator { - private static final Logger LOG = Loggers.get(MetadataGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(MetadataGenerator.class); static final Charset UTF_32BE = Charset.forName("UTF-32BE"); static final Charset UTF_32LE = Charset.forName("UTF-32LE"); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFileIndexer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFileIndexer.java index 46336597f6d..35d5bf3fdb4 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFileIndexer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFileIndexer.java @@ -45,8 +45,8 @@ import org.sonar.api.batch.fs.internal.DefaultInputModule; import org.sonar.api.batch.scm.IgnoreCommand; import org.sonar.api.notifications.AnalysisWarnings; import org.sonar.api.scan.filesystem.PathResolver; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.bootstrap.GlobalConfiguration; import org.sonar.scanner.bootstrap.GlobalServerSettings; import org.sonar.scanner.fs.InputModuleHierarchy; @@ -65,7 +65,7 @@ import static java.util.Collections.singletonList; */ public class ProjectFileIndexer { - private static final Logger LOG = Loggers.get(ProjectFileIndexer.class); + private static final Logger LOG = LoggerFactory.getLogger(ProjectFileIndexer.class); private final ProjectExclusionFilters projectExclusionFilters; private final SonarGlobalPropertiesFilter sonarGlobalPropertiesFilter; private final ProjectCoverageAndDuplicationExclusions projectCoverageAndDuplicationExclusions; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/DefaultBlameOutput.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/DefaultBlameOutput.java index 11ec6835ec4..b8ec3fb8274 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/DefaultBlameOutput.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/DefaultBlameOutput.java @@ -34,8 +34,8 @@ import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.batch.scm.BlameCommand.BlameOutput; import org.sonar.api.batch.scm.BlameLine; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.documentation.DocumentationLinkGenerator; import org.sonar.scanner.protocol.output.ScannerReport; import org.sonar.scanner.protocol.output.ScannerReport.Changesets.Builder; @@ -47,7 +47,7 @@ import static org.sonar.api.utils.Preconditions.checkArgument; class DefaultBlameOutput implements BlameOutput { - private static final Logger LOG = Loggers.get(DefaultBlameOutput.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultBlameOutput.class); @VisibleForTesting static final String SCM_INTEGRATION_DOCUMENTATION_SUFFIX = "/analyzing-source-code/scm-integration/"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java index 098b773fa16..a94e2dbb6d3 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java @@ -33,8 +33,8 @@ import org.sonar.api.batch.scm.ScmProvider; import org.sonar.api.config.Configuration; import org.sonar.api.notifications.AnalysisWarnings; import org.sonar.api.utils.MessageException; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.config.ScannerProperties; import org.sonar.scanner.fs.InputModuleHierarchy; @@ -53,7 +53,7 @@ import static org.sonar.api.CoreProperties.SCM_PROVIDER_KEY; type = PropertyType.BOOLEAN) }) public class ScmConfiguration implements Startable { - private static final Logger LOG = Loggers.get(ScmConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(ScmConfiguration.class); public static final String FORCE_RELOAD_KEY = "sonar.scm.forceReloadAll"; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmPublisher.java index cabf45a65cf..ecd331a7569 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmPublisher.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmPublisher.java @@ -29,8 +29,8 @@ import org.sonar.api.batch.fs.InputFile.Status; import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.batch.scm.ScmProvider; import org.sonar.api.notifications.AnalysisWarnings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.documentation.DocumentationLinkGenerator; import org.sonar.scanner.protocol.output.ScannerReport; import org.sonar.scanner.protocol.output.ScannerReport.Changesets.Builder; @@ -43,7 +43,7 @@ import org.sonar.scanner.scan.filesystem.InputComponentStore; public final class ScmPublisher { - private static final Logger LOG = Loggers.get(ScmPublisher.class); + private static final Logger LOG = LoggerFactory.getLogger(ScmPublisher.class); private final ScmConfiguration configuration; private final ProjectRepositories projectRepositories; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmRevisionImpl.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmRevisionImpl.java index a27af6beb3f..aede322d948 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmRevisionImpl.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmRevisionImpl.java @@ -21,8 +21,8 @@ package org.sonar.scanner.scm; import java.util.Optional; import org.sonar.api.batch.scm.ScmProvider; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.bootstrap.ScannerProperties; import org.sonar.scanner.ci.CiConfiguration; import org.sonar.scanner.fs.InputModuleHierarchy; @@ -32,7 +32,7 @@ import static org.sonar.scanner.scan.ScanProperties.SCM_REVISION; public class ScmRevisionImpl implements ScmRevision { - private static final Logger LOG = Loggers.get(ScmRevisionImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(ScmRevisionImpl.class); private final CiConfiguration ciConfiguration; private final ScannerProperties scannerConfiguration; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/AbstractSensorWrapper.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/AbstractSensorWrapper.java index 8dd91949af1..8f51fa78062 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/AbstractSensorWrapper.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/AbstractSensorWrapper.java @@ -22,14 +22,14 @@ package org.sonar.scanner.sensor; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor; import org.sonar.api.scanner.sensor.ProjectSensor; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.scan.branch.BranchConfiguration; import org.sonar.scanner.scan.branch.BranchType; import org.sonar.scanner.scan.filesystem.MutableFileSystem; public abstract class AbstractSensorWrapper<G extends ProjectSensor> { - private static final Logger LOGGER = Loggers.get(AbstractSensorWrapper.class); + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractSensorWrapper.class); private final G wrappedSensor; private final SensorContext context; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java index 4f42793bf9a..0db519fc36c 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java @@ -57,8 +57,8 @@ import org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable; import org.sonar.api.config.Configuration; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.utils.KeyValueFormat; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.metric.ScannerMetrics; import org.sonar.core.util.CloseableIterator; import org.sonar.duplications.block.Block; @@ -83,7 +83,7 @@ import static org.sonar.api.measures.CoreMetrics.TEST_SUCCESS_DENSITY_KEY; public class DefaultSensorStorage implements SensorStorage { - private static final Logger LOG = Loggers.get(DefaultSensorStorage.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultSensorStorage.class); private static final int DEFAULT_CPD_MIN_LINES = 10; /** diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ModuleSensorsExecutor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ModuleSensorsExecutor.java index 8216f3b93c0..61c9362da86 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ModuleSensorsExecutor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ModuleSensorsExecutor.java @@ -24,15 +24,15 @@ import java.util.Collection; import java.util.stream.Collectors; import java.util.stream.Stream; import org.sonar.api.batch.fs.internal.SensorStrategy; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.util.logs.Profiler; import org.sonar.scanner.bootstrap.ScannerPluginRepository; import org.sonar.api.batch.fs.internal.DefaultInputModule; import org.sonar.scanner.fs.InputModuleHierarchy; public class ModuleSensorsExecutor { - private static final Logger LOG = Loggers.get(ModuleSensorsExecutor.class); + private static final Logger LOG = LoggerFactory.getLogger(ModuleSensorsExecutor.class); private static final Profiler profiler = Profiler.create(LOG); private final ModuleSensorExtensionDictionary selector; private final SensorStrategy strategy; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ProjectSensorsExecutor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ProjectSensorsExecutor.java index 840728c9e96..84a82e49cb6 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ProjectSensorsExecutor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/ProjectSensorsExecutor.java @@ -21,13 +21,13 @@ package org.sonar.scanner.sensor; import java.util.List; import java.util.stream.Collectors; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.util.logs.Profiler; import org.sonar.scanner.bootstrap.ScannerPluginRepository; public class ProjectSensorsExecutor { - private static final Logger LOG = Loggers.get(ProjectSensorsExecutor.class); + private static final Logger LOG = LoggerFactory.getLogger(ProjectSensorsExecutor.class); private static final Profiler profiler = Profiler.create(LOG); private final ProjectSensorExtensionDictionary selector; private final ScannerPluginRepository pluginRepo; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/UnchangedFilesHandler.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/UnchangedFilesHandler.java index 448d608b1c3..be28eeadd85 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/UnchangedFilesHandler.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/UnchangedFilesHandler.java @@ -24,12 +24,12 @@ import java.util.Set; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.config.Configuration; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.scanner.scan.branch.BranchConfiguration; public class UnchangedFilesHandler { - private static final Logger LOG = Loggers.get(UnchangedFilesHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(UnchangedFilesHandler.class); private static final Set<SensorId> ENABLED_SENSORS = Set.of( new SensorId("cpp", "CFamily"), new SensorId("cobol", "CobolSquidSensor"), diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/util/ProgressReport.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/util/ProgressReport.java index 622a0f590ba..e969b8a62d0 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/util/ProgressReport.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/util/ProgressReport.java @@ -20,12 +20,12 @@ package org.sonar.scanner.util; import javax.annotation.Nullable; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ProgressReport implements Runnable { - private static final Logger LOG = Loggers.get(ProgressReport.class); + private static final Logger LOG = LoggerFactory.getLogger(ProgressReport.class); private final long period; private long startTime; private String message = ""; |