diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-09 15:08:41 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-14 09:07:59 +0200 |
commit | ae034306558d3483eae35ada281036e53e833317 (patch) | |
tree | 90606fc616cd000da1dff198d495c0ed5115e1d6 /plugins | |
parent | c8304e492d768415a90d4aace5defd8e49f9ce62 (diff) | |
download | sonarqube-ae034306558d3483eae35ada281036e53e833317.tar.gz sonarqube-ae034306558d3483eae35ada281036e53e833317.zip |
Improve logging
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-git-plugin/src/main/java/org/sonar/plugins/scm/git/JGitBlameCommand.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/sonar-git-plugin/src/main/java/org/sonar/plugins/scm/git/JGitBlameCommand.java b/plugins/sonar-git-plugin/src/main/java/org/sonar/plugins/scm/git/JGitBlameCommand.java index 3e3d6642e2b..4d02b1cfeda 100644 --- a/plugins/sonar-git-plugin/src/main/java/org/sonar/plugins/scm/git/JGitBlameCommand.java +++ b/plugins/sonar-git-plugin/src/main/java/org/sonar/plugins/scm/git/JGitBlameCommand.java @@ -23,6 +23,8 @@ import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.BatchComponent; import org.sonar.api.batch.InstantiationStrategy; import org.sonar.api.batch.fs.FileSystem; @@ -39,6 +41,8 @@ import java.util.List; @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public class JGitBlameCommand implements BlameCommand, BatchComponent { + private static final Logger LOG = LoggerFactory.getLogger(JGitBlameCommand.class); + private final PathResolver pathResolver; public JGitBlameCommand(PathResolver pathResolver) { @@ -76,6 +80,9 @@ public class JGitBlameCommand implements BlameCommand, BatchComponent { List<BlameLine> lines = new ArrayList<BlameLine>(); for (int i = 0; i < blameResult.getResultContents().size(); i++) { if (blameResult.getSourceAuthor(i) == null || blameResult.getSourceCommit(i) == null || blameResult.getSourceCommitter(i) == null) { + LOG.info("Author: " + blameResult.getSourceAuthor(i)); + LOG.info("Committer: " + blameResult.getSourceCommitter(i)); + LOG.info("Source commit: " + blameResult.getSourceCommit(i)); throw new IllegalStateException("Unable to blame file " + inputFile.relativePath() + ". No blame info at line " + (i + 1) + ". Is file commited?"); } lines.add(new org.sonar.api.batch.scm.BlameLine(blameResult.getSourceAuthor(i).getWhen(), |