Skip to content

Commit

Permalink
Optimize and clean up LoggingHandler
Browse files Browse the repository at this point in the history
- Use ': ' instead of '(...)' for simpler string concatenation and prettier presentation
- Optimize the overall performance of format*() methods
- All format*() methods are now expected to encode the channel information by themselves so that StringBuilder instances are created less often.
- Use a look-up table for generating per-row prefixes
- Hid formatByteBuf(), formatByteBufHolder(), and formatNonByteBuf() from user because a user can always override format(ctx, eventName, arg).  For example, to disable hexdump:

    protected void format(ChannelHandlerContext ctx, String eventName, Object arg) {
        if (arg instanceof ByteBuf) {
            super.format(ctx, eventName, arg.toString());
        } else {
            super.format(ctx, eventName, arg);
        }
    }
  • Loading branch information
trustin committed Dec 2, 2013
1 parent a4e4479 commit 5e575da
Show file tree
Hide file tree
Showing 2 changed files with 275 additions and 115 deletions.
Loading

0 comments on commit 5e575da

Please sign in to comment.