Skip to content

Commit 45194a6

Browse files
authored
Merge pull request #157 from pusher/remove_slf4j
Remove dependency on slf4j-api in favor of JUL
2 parents 0732556 + f4f18d5 commit 45194a6

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ language: java
22
sudo: false
33
jdk:
44
- oraclejdk8
5-
- oraclejdk7
65
script:
76
- ./gradlew test

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ repositories {
4343

4444
dependencies {
4545
compile "com.google.code.gson:gson:2.2.2"
46-
compile "org.slf4j:slf4j-api:1.7.5"
4746
compile "com.pusher:java-websocket:1.4.1"
4847
testCompile "org.mockito:mockito-all:1.8.5"
4948
testCompile "org.powermock:powermock-module-junit4:1.4.11"

src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
import java.util.concurrent.ConcurrentHashMap;
1111
import java.util.concurrent.Future;
1212
import java.util.concurrent.TimeUnit;
13+
import java.util.logging.Logger;
1314

1415
import javax.net.ssl.SSLException;
1516

1617
import com.pusher.java_websocket.handshake.ServerHandshake;
17-
import org.slf4j.Logger;
18-
import org.slf4j.LoggerFactory;
1918

2019
import com.google.gson.Gson;
2120

@@ -26,7 +25,7 @@
2625
import com.pusher.client.util.Factory;
2726

2827
public class WebSocketConnection implements InternalConnection, WebSocketListener {
29-
private static final Logger log = LoggerFactory.getLogger(WebSocketConnection.class);
28+
private static final Logger log = Logger.getLogger(WebSocketConnection.class.getName());
3029
private static final Gson GSON = new Gson();
3130

3231
private static final String INTERNAL_EVENT_PREFIX = "pusher:";
@@ -147,7 +146,7 @@ public String getSocketId() {
147146
/* implementation detail */
148147

149148
private void updateState(final ConnectionState newState) {
150-
log.debug("State transition requested, current [" + state + "], new [" + newState + "]");
149+
log.fine("State transition requested, current [" + state + "], new [" + newState + "]");
151150

152151
final ConnectionStateChange change = new ConnectionStateChange(state, newState);
153152
state = newState;
@@ -263,7 +262,7 @@ public void run() {
263262
@Override
264263
public void onClose(final int code, final String reason, final boolean remote) {
265264
if (state == ConnectionState.DISCONNECTED || state == ConnectionState.RECONNECTING) {
266-
log.error("Received close from underlying socket when already disconnected." + "Close code ["
265+
log.warning("Received close from underlying socket when already disconnected." + "Close code ["
267266
+ code + "], Reason [" + reason + "], Remote [" + remote + "]");
268267
return;
269268
}
@@ -354,7 +353,7 @@ synchronized void activity() {
354353
pingTimer = factory.getTimers().schedule(new Runnable() {
355354
@Override
356355
public void run() {
357-
log.debug("Sending ping");
356+
log.fine("Sending ping");
358357
sendMessage(PING_EVENT_SERIALIZED);
359358
schedulePongCheck();
360359
}
@@ -385,7 +384,7 @@ private synchronized void schedulePongCheck() {
385384
pongTimer = factory.getTimers().schedule(new Runnable() {
386385
@Override
387386
public void run() {
388-
log.debug("Timed out awaiting pong from server - disconnecting");
387+
log.fine("Timed out awaiting pong from server - disconnecting");
389388

390389
underlyingConnection.removeWebSocketListener();
391390

0 commit comments

Comments
 (0)