cleanup WebSocket logging in EventSocket

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-01-13 11:02:11 +11:00
parent e1f19be353
commit a7b9df96fd
1 changed files with 8 additions and 4 deletions

View File

@ -59,21 +59,24 @@ public class EventSocket
{
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();
@ -82,7 +85,8 @@ public class EventSocket
@OnWebSocketError
public void onError(Throwable cause)
{
LOG.info("{} onError(): {}", toString(), cause);
if (LOG.isDebugEnabled())
LOG.debug("{} onError(): {}", toString(), cause);
failure = cause;
error.countDown();
}