[rest-gradle-plugin] 46/83: Use the plugin's own logger instance to print progress messaages
Alastair McKinstry
mckinstry at moszumanska.debian.org
Wed Oct 25 15:59:06 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository rest-gradle-plugin.
commit 2a9168fd44d848695b41291a85d644009bcf0957
Author: noamt <noam at 10ne.org>
Date: Sun Feb 22 14:16:12 2015 +0200
Use the plugin's own logger instance to print progress messaages
---
src/main/groovy/org/_10ne/gradle/rest/RestTask.groovy | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/main/groovy/org/_10ne/gradle/rest/RestTask.groovy b/src/main/groovy/org/_10ne/gradle/rest/RestTask.groovy
index 3230e24..05de2cf 100644
--- a/src/main/groovy/org/_10ne/gradle/rest/RestTask.groovy
+++ b/src/main/groovy/org/_10ne/gradle/rest/RestTask.groovy
@@ -26,12 +26,16 @@ import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction
import org.gradle.api.GradleException
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* @author Noam Y. Tenne
*/
class RestTask extends DefaultTask {
+ private static Logger slf4jLogger = LoggerFactory.getLogger(RestTask)
+
RESTClient client
@Input String httpMethod
@@ -62,7 +66,7 @@ class RestTask extends DefaultTask {
String proxyHost = System.getProperty("${protocol}.proxyHost", '')
int proxyPort = System.getProperty("${protocol}.proxyPort", '0') as int
if (StringUtils.isNotBlank(proxyHost) && proxyPort > 0) {
- logger.info "Using ${protocol.toUpperCase()} proxy: $proxyHost:$proxyPort"
+ slf4jLogger.info "Using ${protocol.toUpperCase()} proxy: $proxyHost:$proxyPort"
client.setProxy(proxyHost, proxyPort, protocol)
}
}
@@ -99,11 +103,11 @@ class RestTask extends DefaultTask {
params.requestContentType = requestContentType
}
- logger.info "Executing a '$httpMethod' request to '$uri'"
+ slf4jLogger.info "Executing a '$httpMethod' request to '$uri'"
try {
serverResponse = client."${httpMethod.toLowerCase()}"(params)
- logger.info "Server Response:" + System.lineSeparator() + serverResponse.getData()
+ slf4jLogger.info "Server Response:" + System.lineSeparator() + serverResponse.getData()
} catch(groovyx.net.http.HttpResponseException e) {
throw new GradleException(e.getResponse().getData().toString(), e)
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/rest-gradle-plugin.git
More information about the pkg-java-commits
mailing list