Example #1
0
  public static void trace(Logger logger, String msg, Throwable e) {
    if (logger == null) {
      return;
    }

    if (logger.isTraceEnabled()) {
      logger.trace(msg, e);
    }
  }
Example #2
0
  public static void trace(Logger logger, Throwable throwable) {
    if (logger == null) {
      return;
    }

    if (logger.isTraceEnabled()) {
      logger.trace(throwable);
    }
  }
Example #3
0
  public void encode(Channel channel, ChannelBuffer buffer, Object msg) throws IOException {
    if (msg instanceof Request) {
      encodeRequest(channel, buffer, (Request) msg);
    } else if (msg instanceof Response) {
      encodeResponse(channel, buffer, (Response) msg);
    } else {
      super.encode(channel, buffer, msg);
    }

    // TODO modified by lishen
    //        System.out.println(">>>>>>>>>>>>>>>>>>>>>> the resulting byte size of encoding is " +
    // buffer.readableBytes());
    if (logger.isTraceEnabled()) {
      logger.trace("the resulting byte size of encoding is " + buffer.readableBytes());
    }
  }