}
private ByteBuf logIfNecessary(ChannelHandlerContext ctx, ByteBuf byteBuf) {
if (MainServerHandlerBuilder.this.log.isInfoEnabled()) {
JIDContext context = ctx.attr(MainServerHandlerBuilder.this.attrContext).get();
MainServerHandlerBuilder.this.log.info("Read on " + (context != null && context.jid() != null ? context.jid().asString() : "N/A") + ": " + byteBuf.toString(Charset.forName("UTF-8")));
byteBuf.readerIndex(0);
}
return byteBuf;
}
}