THRIFT-4726: Remove SLF4J Logging Guards

This commit is contained in:
Beluga Behr 2019-01-06 15:20:02 -05:00 committed by James E. King III
parent d2c6dc8e44
commit 93e8ec2d6a
2 changed files with 8 additions and 12 deletions

View File

@ -320,11 +320,9 @@ public class TThreadPoolServer extends TServer {
// Ignore err-logging all transport-level/type exceptions
if ((realCause != null && realCause instanceof TTransportException)
|| (x instanceof TTransportException)) {
if (LOGGER.isDebugEnabled()) {
// Write to debug, just in case the exception gets required
LOGGER
.debug("Received TTransportException during processing of message, ignoring: ", x);
}
LOGGER.debug(
"Received TTransportException during processing of message. Ignoring.",
x);
} else {
// Log the exception at error level and continue
LOGGER.error("Error occurred during processing of message.", x);

View File

@ -158,9 +158,9 @@ abstract class TSaslTransport extends TTransport {
messageHeader[0] = status.getValue();
EncodingUtils.encodeBigEndian(payload.length, messageHeader, STATUS_BYTES);
if (LOGGER.isDebugEnabled())
LOGGER.debug(getRole() + ": Writing message with status {} and payload length {}",
status, payload.length);
LOGGER.debug("{}: Writing message with status {} and payload length {}",
getRole(), status, payload.length);
underlyingTransport.write(messageHeader);
underlyingTransport.write(payload);
underlyingTransport.flush();
@ -197,10 +197,8 @@ abstract class TSaslTransport extends TTransport {
String remoteMessage = new String(payload, StandardCharsets.UTF_8);
throw new TTransportException("Peer indicated failure: " + remoteMessage);
}
if (LOGGER.isDebugEnabled())
LOGGER.debug(getRole() + ": Received message with status {} and payload length {}",
status, payload.length);
LOGGER.debug("{}: Received message with status {} and payload length {}",
getRole(), status, payload.length);
return new SaslResponse(status, payload);
}