Merge pull request #423 from sergey-davydov/donotformateventdata
Add condition to log only if fine level is loggable
This commit is contained in:
@@ -6,6 +6,7 @@ import okhttp3.Call;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.WebSocket;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import java.net.URI;
|
||||
@@ -75,11 +76,15 @@ public class IO {
|
||||
Manager io;
|
||||
|
||||
if (newConnection) {
|
||||
logger.fine(String.format("ignoring socket cache for %s", source));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("ignoring socket cache for %s", source));
|
||||
}
|
||||
io = new Manager(source, opts);
|
||||
} else {
|
||||
if (!managers.containsKey(id)) {
|
||||
logger.fine(String.format("new io instance for %s", source));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("new io instance for %s", source));
|
||||
}
|
||||
managers.putIfAbsent(id, new Manager(source, opts));
|
||||
}
|
||||
io = managers.get(id);
|
||||
|
||||
Reference in New Issue
Block a user