/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }