Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dba84a3

Browse filesBrowse files
committed
Logger should be static
1 parent ae49166 commit dba84a3
Copy full SHA for dba84a3

File tree

Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed

‎src/main/java/org/kohsuke/github/Requester.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/Requester.java
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import java.util.Locale;
4949
import java.util.Map;
5050
import java.util.NoSuchElementException;
51-
import java.util.logging.Level;
5251
import java.util.logging.Logger;
5352
import java.util.regex.Matcher;
5453
import java.util.regex.Pattern;
@@ -57,6 +56,7 @@
5756
import javax.annotation.WillClose;
5857

5958
import static java.util.Arrays.asList;
59+
import static java.util.logging.Level.FINE;
6060
import static org.kohsuke.github.GitHub.*;
6161

6262
/**
@@ -65,10 +65,6 @@
6565
* @author Kohsuke Kawaguchi
6666
*/
6767
class Requester {
68-
private static final List<String> METHODS_WITHOUT_BODY = asList("GET", "DELETE");
69-
70-
protected final transient Logger logger = Logger.getLogger(getClass().getName());
71-
7268
private final GitHub root;
7369
private final List<Entry> args = new ArrayList<Entry>();
7470
private final Map<String,String> headers = new LinkedHashMap<String, String>();
@@ -530,8 +526,8 @@ private InputStream wrapStream(InputStream in) throws IOException {
530526
} catch (IOException e2) {
531527
// likely to be a network exception (e.g. SSLHandshakeException),
532528
// uc.getResponseCode() and any other getter on the response will cause an exception
533-
if (logger.isLoggable(Level.FINE))
534-
logger.log(Level.FINE, "Silently ignore exception retrieving response code for '" + uc.getURL() + "'" +
529+
if (LOGGER.isLoggable(FINE))
530+
LOGGER.log(FINE, "Silently ignore exception retrieving response code for '" + uc.getURL() + "'" +
535531
" handling exception " + e, e);
536532
throw e;
537533
}
@@ -557,4 +553,7 @@ private InputStream wrapStream(InputStream in) throws IOException {
557553
IOUtils.closeQuietly(es);
558554
}
559555
}
556+
557+
private static final List<String> METHODS_WITHOUT_BODY = asList("GET", "DELETE");
558+
private static final Logger LOGGER = Logger.getLogger(Requester.class.getName());
560559
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.