Skip to content

Commit

Permalink
Reset ConnectionWatchdog log-prefix after connect #645
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Nov 12, 2017
1 parent 47acf91 commit ef21b53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1150,10 +1150,9 @@ protected String logPrefix() {
return logPrefix;
}

StringBuffer buffer = new StringBuffer(64);
buffer.append('[').append(ChannelLogDescriptor.logDescriptor(channel)).append(", ").append("chid=0x")
.append(Long.toHexString(commandHandlerId)).append(']');
return logPrefix = buffer.toString();
String buffer = "[" + ChannelLogDescriptor.logDescriptor(channel) + ", " + "chid=0x"
+ Long.toHexString(commandHandlerId) + ']';
return logPrefix = buffer;
}

protected static <T> List<T> drainCommands(Queue<T> source) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public void channelActive(ChannelHandlerContext ctx) throws Exception {
}

reconnectScheduleTimeout = null;
logPrefix = null;
channel = ctx.channel();
remoteAddress = channel.remoteAddress();
logger.debug("{} channelActive({})", logPrefix(), ctx);
Expand Down Expand Up @@ -348,9 +349,7 @@ private String logPrefix() {
return logPrefix;
}

StringBuilder buffer = new StringBuilder(64);
buffer.append('[')
.append(ChannelLogDescriptor.logDescriptor(channel)).append(", last known addr=").append(remoteAddress).append(']');
return logPrefix = buffer.toString();
String buffer = "[" + ChannelLogDescriptor.logDescriptor(channel) + ", last known addr=" + remoteAddress + ']';
return logPrefix = buffer;
}
}

0 comments on commit ef21b53

Please sign in to comment.