From 62590ab1a0cfac5ded829e0b4e4a788c804ea735 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 29 Jan 2020 17:00:48 -0800 Subject: [PATCH] Reduce output from connection retry --- src/main/java/org/kohsuke/github/Requester.java | 5 ++--- src/test/java/org/kohsuke/github/RequesterRetryTest.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/kohsuke/github/Requester.java b/src/main/java/org/kohsuke/github/Requester.java index d106f1c344..9f59da9934 100644 --- a/src/main/java/org/kohsuke/github/Requester.java +++ b/src/main/java/org/kohsuke/github/Requester.java @@ -549,9 +549,8 @@ private boolean retryConnectionError(IOException e, int retries) throws IOExcept || e instanceof SSLHandshakeException; if (connectionError && retries > 0) { LOGGER.log(INFO, - "Error while connecting to " + uc.getURL() + ". Sleeping " + Requester.retryTimeoutMillis - + " milliseconds before retrying... ; will try " + retries + " more time(s)", - e); + e.getMessage() + " while connecting to " + uc.getURL() + ". Sleeping " + Requester.retryTimeoutMillis + + " milliseconds before retrying... ; will try " + retries + " more time(s)"); try { Thread.sleep(Requester.retryTimeoutMillis); } catch (InterruptedException ie) { diff --git a/src/test/java/org/kohsuke/github/RequesterRetryTest.java b/src/test/java/org/kohsuke/github/RequesterRetryTest.java index 62b4363874..098fd6c918 100644 --- a/src/test/java/org/kohsuke/github/RequesterRetryTest.java +++ b/src/test/java/org/kohsuke/github/RequesterRetryTest.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.logging.Handler; import java.util.logging.Logger; +import java.util.logging.SimpleFormatter; import java.util.logging.StreamHandler; import javax.net.ssl.SSLHandshakeException; @@ -55,8 +56,7 @@ private GHRepository getRepository(GitHub gitHub) throws IOException { @Before public void attachLogCapturer() { logCapturingStream = new ByteArrayOutputStream(); - Handler[] handlers = log.getParent().getHandlers(); - customLogHandler = new StreamHandler(logCapturingStream, handlers[0].getFormatter()); + customLogHandler = new StreamHandler(logCapturingStream, new SimpleFormatter()); log.addHandler(customLogHandler); }