Properly fix debug logging

This commit is contained in:
Andrew Steinborn
2020-08-06 11:09:11 -04:00
parent b2d9e11217
commit 6cec09974a

View File

@@ -157,12 +157,12 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
logger.error("{}: read timed out", association); logger.error("{}: read timed out", association);
} else { } else {
boolean isQuietDecoderException = cause instanceof QuietDecoderException; boolean isQuietDecoderException = cause instanceof QuietDecoderException;
boolean willLogQuietDecoderException = MinecraftDecoder.DEBUG || (isQuietDecoderException boolean willLogQuietDecoderException = !isQuietDecoderException
&& !(sessionHandler instanceof LoginSessionHandler) || (!(sessionHandler instanceof LoginSessionHandler)
&& !(sessionHandler instanceof HandshakeSessionHandler)); && !(sessionHandler instanceof HandshakeSessionHandler));
if (willLogQuietDecoderException) { if (willLogQuietDecoderException) {
logger.error("{}: exception encountered in {}", association, sessionHandler, cause); logger.error("{}: exception encountered in {}", association, sessionHandler, cause);
} else if (isQuietDecoderException) { } else {
knownDisconnect = true; knownDisconnect = true;
} }
} }