当前位置: 首页>>代码示例>>Java>>正文


Java IThrowableProxy.getCommonFrames方法代码示例

本文整理汇总了Java中ch.qos.logback.classic.spi.IThrowableProxy.getCommonFrames方法的典型用法代码示例。如果您正苦于以下问题:Java IThrowableProxy.getCommonFrames方法的具体用法?Java IThrowableProxy.getCommonFrames怎么用?Java IThrowableProxy.getCommonFrames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.qos.logback.classic.spi.IThrowableProxy的用法示例。


在下文中一共展示了IThrowableProxy.getCommonFrames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
void render(StringBuilder sbuf, IThrowableProxy tp) {
    printFirstLine(sbuf, tp);

    int commonFrames = tp.getCommonFrames();
    StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();

    for (int i = 0; i < stepArray.length - commonFrames; i++) {
        StackTraceElementProxy step = stepArray[i];
        sbuf.append(TRACE_PREFIX);
        sbuf.append(Transform.escapeTags(step.toString()));
        sbuf.append(CoreConstants.LINE_SEPARATOR);
    }

    if (commonFrames > 0) {
        sbuf.append(TRACE_PREFIX);
        sbuf.append("\t... ").append(commonFrames).append(" common frames omitted").append(CoreConstants.LINE_SEPARATOR);
    }
}
 
开发者ID:zhaoqilong3031,项目名称:spring-cloud-samples,代码行数:19,代码来源:DefaultThrowableRenderer.java

示例2: render

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
void render(StringBuilder sbuf, IThrowableProxy tp) {
  printFirstLine(sbuf, tp);
  
  int commonFrames = tp.getCommonFrames();
  StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
  
  for (int i = 0; i < stepArray.length - commonFrames; i++) {
    StackTraceElementProxy step = stepArray[i];
    sbuf.append(TRACE_PREFIX);
    sbuf.append(Transform.escapeTags(step.toString()));
    sbuf.append(CoreConstants.LINE_SEPARATOR);
  }
  
  if (commonFrames > 0) {
    sbuf.append(TRACE_PREFIX);
    sbuf.append("\t... ").append(commonFrames).append(" common frames omitted")
        .append(CoreConstants.LINE_SEPARATOR);
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:20,代码来源:DefaultThrowableRenderer.java

示例3: subjoinThrowableProxy

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
void subjoinThrowableProxy(StringBuilder buf, IThrowableProxy tp) {
    subjoinFirstLine(buf, tp);


    buf.append(CoreConstants.LINE_SEPARATOR);
    final StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
    final int commonFrames = tp.getCommonFrames();

    int maxIndex = stepArray.length;
    if (commonFrames > 0) {
        maxIndex -= commonFrames;
    }

    for (int i = 0; i < maxIndex; i++) {
        final String string = stepArray[i].toString();
        buf.append(PREFIX);
        buf.append(string);
        extraData(buf, stepArray[i]); // allow other data to be added
        buf.append(CoreConstants.LINE_SEPARATOR);
    }

    if (commonFrames > 0) {
        buf.append("!... ").append(tp.getCommonFrames()).append(
                " common frames omitted").append(CoreConstants.LINE_SEPARATOR);
    }
}
 
开发者ID:bither,项目名称:bither-desktop-java,代码行数:27,代码来源:PrefixedThrowableProxyConverter.java

示例4: printFirstLine

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) {
    int commonFrames = tp.getCommonFrames();
    if (commonFrames > 0) {
        sb.append("\t").append(CoreConstants.CAUSED_BY);
    }
    sb.append(tp.getClassName()).append(": ").append(Transform.escapeTags(tp.getMessage()));
    sb.append(CoreConstants.LINE_SEPARATOR);
}
 
开发者ID:zhaoqilong3031,项目名称:spring-cloud-samples,代码行数:9,代码来源:DefaultThrowableRenderer.java

示例5: subjoinSTEPArray

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
protected void subjoinSTEPArray(StringBuilder buf, int indent, IThrowableProxy tp) {
  StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
  int commonFrames = tp.getCommonFrames();

  boolean unrestrictedPrinting = lengthOption > stepArray.length;


  int maxIndex = (unrestrictedPrinting) ? stepArray.length : lengthOption;
  if (commonFrames > 0 && unrestrictedPrinting) {
    maxIndex -= commonFrames;
  }

  int ignoredCount = 0;
  for (int i = 0; i < maxIndex; i++) {
    StackTraceElementProxy element = stepArray[i];
    if (!isIgnoredStackTraceLine(element.toString())) {
      ThrowableProxyUtil.indent(buf, indent);
      printStackLine(buf, ignoredCount, element);
      ignoredCount = 0;
      buf.append(CoreConstants.LINE_SEPARATOR);
    } else {
      ++ignoredCount;
      if (maxIndex < stepArray.length) {
        ++maxIndex;
      }
    }
  }
  if (ignoredCount > 0) {
    printIgnoredCount(buf, ignoredCount);
    buf.append(CoreConstants.LINE_SEPARATOR);
  }

  if (commonFrames > 0 && unrestrictedPrinting) {
    ThrowableProxyUtil.indent(buf, indent);
    buf.append("... ").append(tp.getCommonFrames()).append(
            " common frames omitted").append(CoreConstants.LINE_SEPARATOR);
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:39,代码来源:ThrowableProxyConverter.java

示例6: printFirstLine

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) {
  int commonFrames = tp.getCommonFrames();
  if (commonFrames > 0) {
    sb.append("<br />").append(CoreConstants.CAUSED_BY);
  }
  sb.append(tp.getClassName()).append(": ").append(
      Transform.escapeTags(tp.getMessage()));
  sb.append(CoreConstants.LINE_SEPARATOR);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:10,代码来源:DefaultThrowableRenderer.java

示例7: subjoinFirstLine

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private void subjoinFirstLine(StringBuilder buf, IThrowableProxy tp) {
    final int commonFrames = tp.getCommonFrames();
    if (commonFrames > 0) {
        buf.append(CoreConstants.CAUSED_BY);
    }
    subjoinExceptionMessage(buf, tp);
}
 
开发者ID:bither,项目名称:bither-desktop-java,代码行数:8,代码来源:PrefixedThrowableProxyConverter.java


注:本文中的ch.qos.logback.classic.spi.IThrowableProxy.getCommonFrames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。