aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-06-19 12:05:25 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-06-19 13:31:20 +0200
commitb0c8aeece75f1dcd7069fe4f496eeba2a7832fc4 (patch)
tree90d9663635f43190f139deb1b47d722789a55a23
parent72c623544185e586782fe3813797c49e283d9d95 (diff)
downloadsonarqube-b0c8aeece75f1dcd7069fe4f496eeba2a7832fc4.tar.gz
sonarqube-b0c8aeece75f1dcd7069fe4f496eeba2a7832fc4.zip
SONAR-6463 Improve logging
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java37
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java6
4 files changed, 22 insertions, 30 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
index 2cb75cf6b34..bf1d0815ede 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
@@ -25,9 +25,6 @@ import org.sonar.api.CoreProperties;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.MessageException;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-import org.sonar.api.utils.log.Profiler;
import org.sonar.batch.bootstrap.DefaultAnalysisMode;
import org.sonar.batch.bootstrap.GlobalSettings;
import org.sonar.batch.protocol.input.ProjectRepositories;
@@ -37,8 +34,6 @@ import org.sonar.batch.protocol.input.ProjectRepositories;
*/
public class ModuleSettings extends Settings {
- private static final Logger LOG = Loggers.get(ModuleSettings.class);
-
private final ProjectRepositories projectReferentials;
private DefaultAnalysisMode analysisMode;
@@ -49,9 +44,7 @@ public class ModuleSettings extends Settings {
this.analysisMode = analysisMode;
getEncryption().setPathToSecretKey(batchSettings.getString(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
- Profiler profiler = Profiler.create(LOG).startInfo("Load module settings");
init(moduleDefinition, batchSettings);
- profiler.stopDebug();
}
private ModuleSettings init(ProjectDefinition moduleDefinition, GlobalSettings batchSettings) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
index 8a88312ff81..cc3e3798f07 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
@@ -121,7 +121,7 @@ public class ProjectReactorBuilder {
for (Map.Entry<String, String> entry : propertiesByModuleId.get("").entrySet()) {
taskProps.properties().put((String) entry.getKey(), (String) entry.getValue());
}
- profiler.stopInfo();
+ profiler.stopDebug();
return new ProjectReactor(rootProject);
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
index 017b4b67b91..6edb8e240fa 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
@@ -28,6 +28,8 @@ import org.sonar.api.resources.Languages;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.ResourceTypes;
import org.sonar.api.scan.filesystem.PathResolver;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import org.sonar.batch.DefaultFileLinesContextFactory;
import org.sonar.batch.DefaultProjectTree;
import org.sonar.batch.ProjectConfigurator;
@@ -84,6 +86,8 @@ import org.sonar.core.technicaldebt.DefaultTechnicalDebtModel;
public class ProjectScanContainer extends ComponentContainer {
+ private static final Logger LOG = Loggers.get(ProjectScanContainer.class);
+
private final DefaultAnalysisMode analysisMode;
private final Object[] components;
private final AnalysisProperties props;
@@ -148,14 +152,14 @@ public class ProjectScanContainer extends ComponentContainer {
Caches.class,
BatchComponentCache.class,
- // file system
+ // file system
InputPathCache.class,
PathResolver.class,
- // rules
+ // rules
new ActiveRulesProvider(),
- // issues
+ // issues
IssueUpdater.class,
FunctionExecutor.class,
IssueWorkflow.class,
@@ -164,33 +168,33 @@ public class ProjectScanContainer extends ComponentContainer {
LocalIssueTracking.class,
ServerIssueRepository.class,
- // metrics
+ // metrics
DefaultMetricFinder.class,
DeprecatedMetricFinder.class,
- // tests
+ // tests
TestPlanBuilder.class,
TestableBuilder.class,
- // lang
+ // lang
Languages.class,
DefaultLanguagesRepository.class,
- // Differential periods
+ // Differential periods
PeriodsDefinition.class,
- // Measures
+ // Measures
MeasureCache.class,
- // Duplications
+ // Duplications
DuplicationCache.class,
- // Quality Gate
+ // Quality Gate
new QualityGateProvider(),
- ProjectSettings.class,
+ ProjectSettings.class,
- // Report
+ // Report
ReportPublisher.class,
ComponentsPublisher.class,
IssuesPublisher.class,
@@ -200,21 +204,21 @@ public class ProjectScanContainer extends ComponentContainer {
SourcePublisher.class,
TestExecutionAndCoveragePublisher.class,
- ScanTaskObservers.class);
+ ScanTaskObservers.class);
}
private void addDataBaseComponents() {
add(
PastMeasuresLoader.class,
- // Rules
+ // Rules
new RulesProvider(),
new DebtModelProvider(),
- // technical debt
+ // technical debt
DefaultTechnicalDebtModel.class,
- // Issue tracking
+ // Issue tracking
InitialOpenIssuesStack.class);
}
@@ -224,6 +228,7 @@ public class ProjectScanContainer extends ComponentContainer {
@Override
protected void doAfterStart() {
+ LOG.debug("Start recursive analysis of project modules");
DefaultProjectTree tree = getComponentByType(DefaultProjectTree.class);
scanRecursively(tree.getRootProject());
if (analysisMode.isMediumTest()) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
index e125dd24d64..3219c719864 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
@@ -19,8 +19,6 @@
*/
package org.sonar.batch.scan;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.config.PropertyDefinitions;
@@ -32,8 +30,6 @@ import org.sonar.batch.protocol.input.ProjectRepositories;
public class ProjectSettings extends Settings {
- private static final Logger LOG = LoggerFactory.getLogger(ProjectSettings.class);
-
private final GlobalSettings globalSettings;
private final ProjectRepositories projectRepositories;
private final DefaultAnalysisMode mode;
@@ -49,8 +45,6 @@ public class ProjectSettings extends Settings {
}
private void init(ProjectReactor reactor) {
- LOG.info("Load project settings");
-
addProperties(globalSettings.getProperties());
addProperties(projectRepositories.settings(reactor.getRoot().getKeyWithBranch()));