Skip to content

Commit 4c7bc49

Browse files
committed
use proper logging
1 parent 048e402 commit 4c7bc49

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/main/java/org/jenkinsci/plugins/webhookrelay/WebhookReceiver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onMessage(String message) {
5656

5757
HttpClient client = HttpClientBuilder.create().build();
5858
String postback = (Boolean.getBoolean("hudson.hpi.run"))? "/jenkins/github-webhook/" : "/github-webhook/";
59-
System.out.println(postback);
59+
6060
HttpPost post = new HttpPost(postback);
6161
String contentType = "application/json";
6262

@@ -79,10 +79,11 @@ public void onMessage(String message) {
7979
try {
8080
res = client.execute(new HttpHost(InetAddress.getLocalHost(), 8080), post);
8181
} catch (IOException e) {
82+
LOGGER.warning(String.format("Error posting back webhook: %s", e.getMessage()));
8283
throw new RuntimeException(e);
8384
}
84-
System.out.println(res.toString());
85-
System.out.println("Got msg:" + message);
85+
LOGGER.info(String.format("Result from post back: %s", res.toString()));
86+
8687
}
8788

8889
@Override

src/main/java/org/jenkinsci/plugins/webhookrelay/WebhookRelayPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public WebhookRelayPluginDescriptor() {
4747
load();
4848
//this.relayURI = relayURI;
4949
WebhookRelayStorage.relayURI = relayURI;
50-
LOGGER.info("Here we are XXX - " + relayURI);
50+
LOGGER.info("relayURI - " + relayURI);
5151
}
5252

5353
public String getRelayURI() {

src/main/java/org/jenkinsci/plugins/webhookrelay/WebsocketHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void run() {
5757
try {
5858
Thread.sleep(10000); // In the event of something catastrophic - just backoff a little
5959
} catch (InterruptedException ignore) {
60+
LOGGER.fine("Interrupted listening");
6061
}
6162
}
6263
}

0 commit comments

Comments
 (0)