Skip to content

Commit bdf235d

Browse files
committed
Fix #1417 Change socket mode ping/pong from debug to trace
1 parent 441b008 commit bdf235d

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

slack-api-client/src/main/java/com/slack/api/socket_mode/impl/SocketModeClientJavaWSImpl.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ public void connect() {
130130
public boolean verifyConnection() {
131131
if (this.currentSession != null && this.currentSession.isOpen()) {
132132
try {
133-
if (getLogger().isDebugEnabled()) {
134-
getLogger().debug("Sending a ping message");
133+
if (getLogger().isTraceEnabled()) {
134+
getLogger().trace("Sending a ping message");
135135
}
136136
this.currentSession.sendPing();
137137
long waitMillis = 0L;
138138
while (waitMillis <= 3_000L) {
139139
if (this.currentSession.isPongReceived()) {
140-
if (getLogger().isDebugEnabled()) {
141-
getLogger().debug("Received a pong message");
140+
if (getLogger().isTraceEnabled()) {
141+
getLogger().trace("Received a pong message");
142142
}
143143
return true;
144144
}
@@ -152,8 +152,8 @@ public boolean verifyConnection() {
152152
e.getMessage()
153153
);
154154
}
155-
if (getLogger().isDebugEnabled()) {
156-
getLogger().debug("Failed to receive a pong message");
155+
if (getLogger().isTraceEnabled()) {
156+
getLogger().trace("Failed to receive a pong message");
157157
}
158158
}
159159
return false;

slack-api-client/src/main/java/com/slack/api/socket_mode/impl/SocketModeClientTyrusImpl.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ public void connect() {
187187
public boolean verifyConnection() {
188188
if (this.currentSession != null && this.currentSession.isOpen()) {
189189
String ping = "ping-pong_" + currentSession.getId();
190-
if (getLogger().isDebugEnabled()) {
191-
getLogger().debug("Sending a ping message: {}", ping);
190+
if (getLogger().isTraceEnabled()) {
191+
getLogger().trace("Sending a ping message: {}", ping);
192192
}
193193
ByteBuffer pingBytes = ByteBuffer.wrap(ping.getBytes());
194194
try {
@@ -199,8 +199,8 @@ public boolean verifyConnection() {
199199
while (waitMillis <= 3_000L) {
200200
String pong = latestPong.getAndSet(null);
201201
if (pong != null && pong.equals(ping)) {
202-
if (getLogger().isDebugEnabled()) {
203-
getLogger().debug("Received a pong message: {}", ping);
202+
if (getLogger().isTraceEnabled()) {
203+
getLogger().trace("Received a pong message: {}", ping);
204204
}
205205
return true;
206206
}
@@ -213,8 +213,8 @@ public boolean verifyConnection() {
213213
this.currentSession.getId(),
214214
e.getMessage());
215215
}
216-
if (getLogger().isDebugEnabled()) {
217-
getLogger().debug("Failed to receive a pong message: {}", ping);
216+
if (getLogger().isTraceEnabled()) {
217+
getLogger().trace("Failed to receive a pong message: {}", ping);
218218
}
219219
}
220220
return false;

slack-jakarta-socket-mode-client/src/main/java/com/slack/api/jakarta_socket_mode/impl/JakartaSocketModeClientTyrusImpl.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ public void connect() {
187187
public boolean verifyConnection() {
188188
if (this.currentSession != null && this.currentSession.isOpen()) {
189189
String ping = "ping-pong_" + currentSession.getId();
190-
if (getLogger().isDebugEnabled()) {
191-
getLogger().debug("Sending a ping message: {}", ping);
190+
if (getLogger().isTraceEnabled()) {
191+
getLogger().trace("Sending a ping message: {}", ping);
192192
}
193193
ByteBuffer pingBytes = ByteBuffer.wrap(ping.getBytes());
194194
try {
@@ -199,8 +199,8 @@ public boolean verifyConnection() {
199199
while (waitMillis <= 3_000L) {
200200
String pong = latestPong.getAndSet(null);
201201
if (pong != null && pong.equals(ping)) {
202-
if (getLogger().isDebugEnabled()) {
203-
getLogger().debug("Received a pong message: {}", ping);
202+
if (getLogger().isTraceEnabled()) {
203+
getLogger().trace("Received a pong message: {}", ping);
204204
}
205205
return true;
206206
}
@@ -213,8 +213,8 @@ public boolean verifyConnection() {
213213
this.currentSession.getId(),
214214
e.getMessage());
215215
}
216-
if (getLogger().isDebugEnabled()) {
217-
getLogger().debug("Failed to receive a pong message: {}", ping);
216+
if (getLogger().isTraceEnabled()) {
217+
getLogger().trace("Failed to receive a pong message: {}", ping);
218218
}
219219
}
220220
return false;

0 commit comments

Comments
 (0)