Rename formatUserMessage to formatSimple and use it in two-args formatter in LoggingHandler
This commit is contained in:
parent
0dddec8dfd
commit
99c01aa9f3
@ -324,7 +324,7 @@ public class LoggingHandler extends ChannelHandlerAdapter {
|
||||
} else if (arg instanceof ByteBufHolder) {
|
||||
return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg);
|
||||
} else {
|
||||
return formatUserMessage(ctx, eventName, arg);
|
||||
return formatSimple(ctx, eventName, arg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,7 +337,7 @@ public class LoggingHandler extends ChannelHandlerAdapter {
|
||||
*/
|
||||
protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) {
|
||||
if (secondArg == null) {
|
||||
return format(ctx, eventName, firstArg);
|
||||
return formatSimple(ctx, eventName, firstArg);
|
||||
}
|
||||
|
||||
String chStr = ctx.channel().toString();
|
||||
@ -473,7 +473,7 @@ public class LoggingHandler extends ChannelHandlerAdapter {
|
||||
/**
|
||||
* Generates the default log message of the specified event whose argument is an arbitrary object.
|
||||
*/
|
||||
private static String formatUserMessage(ChannelHandlerContext ctx, String eventName, Object msg) {
|
||||
private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) {
|
||||
String chStr = ctx.channel().toString();
|
||||
String msgStr = String.valueOf(msg);
|
||||
StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());
|
||||
|
Loading…
Reference in New Issue
Block a user