當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。