From 799209b435e1db4111f1ed570be0b97dc5dd11a9 Mon Sep 17 00:00:00 2001 From: Martin Damovsky Date: Sun, 4 Jun 2017 21:20:35 +0200 Subject: Decreased logging level from INFO to FINE across whole plugin --- .../BitbucketRepository.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java') diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java index 02d11c5..2bf320b 100644 --- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java +++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java @@ -90,7 +90,7 @@ public class BitbucketRepository { } public Collection getTargetPullRequests() { - logger.info("Fetch PullRequests."); + logger.fine("Fetch PullRequests."); List pullRequests = client.getPullRequests(); List targetPullRequests = new ArrayList(); for(Pullrequest pullRequest : pullRequests) { @@ -144,7 +144,7 @@ public class BitbucketRepository { String repository = cause.getRepositoryName(); String destinationBranch = cause.getTargetBranch(); - logger.info("setBuildStatus " + state + " for commit: " + sourceCommit + " with url " + buildUrl); + logger.fine("setBuildStatus " + state + " for commit: " + sourceCommit + " with url " + buildUrl); if (state == BuildState.FAILED || state == BuildState.SUCCESSFUL) { comment = String.format(BUILD_DESCRIPTION, builder.getProject().getDisplayName(), sourceCommit, destinationBranch); @@ -170,7 +170,7 @@ public class BitbucketRepository { final static String CONTENT_PART_TEMPLATE = "```[bid: %s]```"; private List getAvailableBuildTagsFromTTPComment(String buildTags) { - logger.log(Level.INFO, "Parse {0}", new Object[]{ buildTags }); + logger.log(Level.FINE, "Parse {0}", new Object[]{ buildTags }); List availableBuildTags = new LinkedList(); Matcher subBuildTagMatcher = SINGLE_BUILD_TAG_RX.matcher(buildTags); while(subBuildTagMatcher.find()) availableBuildTags.add(subBuildTagMatcher.group(0).trim()); @@ -180,18 +180,18 @@ public class BitbucketRepository { public boolean hasMyBuildTagInTTPComment(String content, String buildKey) { Matcher tagsMatcher = BUILD_TAGS_RX.matcher(content); if (tagsMatcher.find()) { - logger.log(Level.INFO, "Content {0} g[1]:{1} mykey:{2}", new Object[] { content, tagsMatcher.group(1).trim(), this.getMyBuildTag(buildKey) }); + logger.log(Level.FINE, "Content {0} g[1]:{1} mykey:{2}", new Object[] { content, tagsMatcher.group(1).trim(), this.getMyBuildTag(buildKey) }); return this.getAvailableBuildTagsFromTTPComment(tagsMatcher.group(1).trim()).contains(this.getMyBuildTag(buildKey)); } else return false; } private void postBuildTagInTTPComment(String pullRequestId, String content, String buildKey) { - logger.log(Level.INFO, "Update build tag for {0} build key", buildKey); + logger.log(Level.FINE, "Update build tag for {0} build key", buildKey); List builds = this.getAvailableBuildTagsFromTTPComment(content); builds.add(this.getMyBuildTag(buildKey)); content += " " + String.format(CONTENT_PART_TEMPLATE, StringUtils.join(builds, " ")); - logger.log(Level.INFO, "Post comment: {0} with original content {1}", new Object[]{ content, this.client.postPullRequestComment(pullRequestId, content).getId() }); + logger.log(Level.FINE, "Post comment: {0} with original content {1}", new Object[]{ content, this.client.postPullRequestComment(pullRequestId, content).getId() }); } private boolean isTTPComment(String content) { @@ -208,7 +208,7 @@ public class BitbucketRepository { } public List filterPullRequestComments(List comments) { - logger.info("Filter PullRequest Comments."); + logger.fine("Filter PullRequest Comments."); Collections.sort(comments); Collections.reverse(comments); List filteredComments = new LinkedList(); @@ -241,7 +241,7 @@ public class BitbucketRepository { final boolean commitAlreadyBeenProcessed = this.client.hasBuildStatus( sourceRepository.getOwnerName(), sourceRepository.getRepositoryName(), sourceCommit, buildKeyPart ); - if (commitAlreadyBeenProcessed) logger.log(Level.INFO, + if (commitAlreadyBeenProcessed) logger.log(Level.FINE, "Commit {0}#{1} has already been processed", new Object[]{ sourceCommit, buildKeyPart } ); @@ -257,7 +257,7 @@ public class BitbucketRepository { String content = comment.getContent(); if (this.isTTPComment(content)) { rebuildCommentAvailable = true; - logger.log(Level.INFO, + logger.log(Level.FINE, "Rebuild comment available for commit {0} and comment #{1}", new Object[]{ sourceCommit, comment.getId() } ); @@ -270,7 +270,7 @@ public class BitbucketRepository { if (rebuildCommentAvailable) this.postBuildTagInTTPComment(id, "TTP build flag", buildKeyPart); final boolean canBuildTarget = rebuildCommentAvailable || !commitAlreadyBeenProcessed; - logger.log(Level.INFO, "Build target? {0} [rebuild:{1} processed:{2}]", new Object[]{ canBuildTarget, rebuildCommentAvailable, commitAlreadyBeenProcessed}); + logger.log(Level.FINE, "Build target? {0} [rebuild:{1} processed:{2}]", new Object[]{ canBuildTarget, rebuildCommentAvailable, commitAlreadyBeenProcessed}); return canBuildTarget; } -- cgit v1.2.3