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

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

    if (logger.isTraceEnabled()) {
      logger.trace(throwable);
    }
  }
Esempio n. 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());
    }
  }