Skip to content

Commit

Permalink
cleanup WebSocket logging in EventSocket
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Jan 13, 2020
1 parent e1f19be commit a7b9df9
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,24 @@ public void onOpen(Session session)
{
this.session = session;
behavior = session.getPolicy().getBehavior().name();
LOG.info("{} onOpen(): {}", toString(), session);
if (LOG.isDebugEnabled())
LOG.debug("{} onOpen(): {}", toString(), session);
open.countDown();
}

@OnWebSocketMessage
public void onMessage(String message) throws IOException
{
LOG.info("{} onMessage(): {}", toString(), message);
if (LOG.isDebugEnabled())
LOG.debug("{} onMessage(): {}", toString(), message);
receivedMessages.offer(message);
}

@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
LOG.debug("{} onClose(): {}:{}", toString(), statusCode, reason);
if (LOG.isDebugEnabled())
LOG.debug("{} onClose(): {}:{}", toString(), statusCode, reason);
closeCode = statusCode;
closeReason = reason;
closed.countDown();
Expand All @@ -82,7 +85,8 @@ public void onClose(int statusCode, String reason)
@OnWebSocketError
public void onError(Throwable cause)
{
LOG.info("{} onError(): {}", toString(), cause);
if (LOG.isDebugEnabled())
LOG.debug("{} onError(): {}", toString(), cause);
failure = cause;
error.countDown();
}
Expand Down

0 comments on commit a7b9df9

Please sign in to comment.