Improve WSClient and party logging

- Remove duplicate logging from both WSClient and plugins listening for
incoming messages
- Log json instead of deserialized message on receiving message (because
toString might not be properly implemented)

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-06 08:15:47 +01:00
parent 09a7dd7579
commit 8c32614ac5
3 changed files with 2 additions and 6 deletions

View File

@@ -234,8 +234,6 @@ public class PartyPlugin extends Plugin implements KeyListener
@Subscribe
public void onTilePing(TilePing event)
{
log.debug("Got tile ping {}", event);
if (config.pings())
{
pendingTilePings.add(new PartyTilePingData(event.getPoint()));

View File

@@ -114,7 +114,6 @@ public class PartyService
@Subscribe
public void onUserJoin(final UserJoin message)
{
log.debug("User {} joined", message);
final PartyMember partyMember = new PartyMember(message.getMemberId(), message.getName());
members.add(partyMember);
@@ -130,7 +129,6 @@ public class PartyService
@Subscribe
public void onUserPart(final UserPart message)
{
log.debug("User {} left", message);
members.removeIf(member -> member.getMemberId().equals(message.getMemberId()));
}

View File

@@ -173,7 +173,7 @@ public class WSClient extends WebSocketListener implements AutoCloseable
return;
}
log.debug("Got message: {}", message);
log.debug("Got: {}", text);
eventBus.post(message);
}
@@ -187,7 +187,7 @@ public class WSClient extends WebSocketListener implements AutoCloseable
@Override
public void onFailure(WebSocket webSocket, Throwable t, Response response)
{
log.warn("Error in websocket", t);
log.warn("Error in websocket {}:{}", response, t);
this.webSocket = null;
}
}