Java 类ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter 实例源码

项目:instalint    文件:LogCallbackAppender.java   
@Override
protected void append(ILoggingEvent event) {
  LogOutput target = tlTtarget.get();
  if (target == null) {
    defaultAppender.doAppend(event);
    return;
  }

  String msg;
  if (event.getThrowableProxy() == null) {
    msg = event.getFormattedMessage();
  } else {
    ExtendedThrowableProxyConverter throwableConverter = new ExtendedThrowableProxyConverter();
    throwableConverter.start();
    msg = event.getFormattedMessage() + "\n" + throwableConverter.convert(event);
    throwableConverter.stop();
  }

  target.log(msg, translate(event.getLevel()));
}