Skip to content

Commit

Permalink
Polish logging in BintrayService
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Sep 17, 2020
1 parent cb4eb92 commit dbd2783
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public boolean isDistributionStarted(ReleaseInfo releaseInfo) {
logger.debug("Checking if distribution is started");
RequestEntity<Void> request = getPackageFilesRequest(releaseInfo, 1);
try {
logger.debug("Checking bintray");
logger.debug("Checking Bintray");
this.restTemplate.exchange(request, PackageFile[].class).getBody();
return true;
}
Expand All @@ -100,7 +100,7 @@ public boolean isDistributionComplete(ReleaseInfo releaseInfo, Set<String> requi
RequestEntity<Void> request = getPackageFilesRequest(releaseInfo, 0);
try {
waitAtMost(timeout).with().pollDelay(Duration.ZERO).pollInterval(pollInterval).until(() -> {
logger.debug("Checking bintray");
logger.debug("Checking Bintray");
try {
PackageFile[] published = this.restTemplate.exchange(request, PackageFile[].class).getBody();
return hasPublishedAll(published, requiredDigests);
Expand All @@ -111,7 +111,7 @@ public boolean isDistributionComplete(ReleaseInfo releaseInfo, Set<String> requi
});
}
catch (ConditionTimeoutException ex) {
logger.debug("Timeout checking bintray");
logger.debug("Timeout checking Bintray");
return false;
}
return true;
Expand All @@ -132,7 +132,7 @@ private boolean hasPublishedAll(PackageFile[] published, Set<String> requiredDig
logger.debug("Found all required digests");
return true;
}
logger.debug("Some digests have not been published:");
logger.debug(remaining.size() + " digests have not been published:");
remaining.forEach(logger::debug);
return false;
}
Expand All @@ -148,18 +148,18 @@ private RequestEntity<Void> getPackageFilesRequest(ReleaseInfo releaseInfo, int
* @param releaseInfo the release information
*/
public void publishGradlePlugin(ReleaseInfo releaseInfo) {
logger.debug("Publishing Gradle Pluging");
logger.debug("Publishing Gradle plugin");
RequestEntity<String> requestEntity = RequestEntity
.post(URI.create(BINTRAY_URL + "packages/" + this.bintrayProperties.getSubject() + "/"
+ this.bintrayProperties.getRepo() + "/" + releaseInfo.getGroupId() + "/versions/"
+ releaseInfo.getVersion() + "/attributes"))
.contentType(MediaType.APPLICATION_JSON).body(GRADLE_PLUGIN_REQUEST);
try {
this.restTemplate.exchange(requestEntity, Object.class);
logger.debug("Publishing Gradle Pluging complete");
logger.debug("Publishing Gradle plugin complete");
}
catch (HttpClientErrorException ex) {
logger.info("Failed to add attribute to gradle plugin.");
logger.info("Failed to add attribute to Gradle plugin");
throw ex;
}
}
Expand All @@ -184,7 +184,7 @@ public void syncToMavenCentral(ReleaseInfo releaseInfo) {
logger.debug("Sync complete");
}
catch (HttpClientErrorException ex) {
logger.info("Failed to sync.");
logger.info("Failed to sync");
throw ex;
}
}
Expand Down

0 comments on commit dbd2783

Please sign in to comment.