Java Code Examples for ch.qos.logback.classic.spi.ThrowableProxyUtil#indent()

The following examples show how to use ch.qos.logback.classic.spi.ThrowableProxyUtil#indent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NSThrowableConvert.java    From ns4_frame with Apache License 2.0 5 votes vote down vote up
private void subjoinFirstLine(StringBuilder buf, String prefix, int indent, IThrowableProxy tp) {
    ThrowableProxyUtil.indent(buf, indent - 1);


    buf.append(LogConstants.PART_SPLIT);
    if (prefix != null) {
        buf.append(prefix);
    }
    subjoinExceptionMessage(buf, tp);
}
 
Example 2
Source File: NSThrowableConvert.java    From ns4_frame with Apache License 2.0 5 votes vote down vote up
@Override
public void subjoinSTEPArray(StringBuilder buf, int indent, IThrowableProxy tp) {
    String totalKey = LogKey.getTotalKey();
    StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
    int commonFrames = tp.getCommonFrames();

    boolean unrestrictedPrinting = Integer.MAX_VALUE > stepArray.length;


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

    for (int i = 0; i < maxIndex; i++) {
        buf.append(totalKey);
        ThrowableProxyUtil.indent(buf, indent);
        buf.append(stepArray[i]);
        extraData(buf, stepArray[i]); // allow other data to be added
        buf.append(CoreConstants.LINE_SEPARATOR);
    }

    if (commonFrames > 0 && unrestrictedPrinting) {
        buf.append(totalKey);
        ThrowableProxyUtil.indent(buf, indent);
        buf.append("... ").append(tp.getCommonFrames()).append(
                " common frames omitted").append(CoreConstants.LINE_SEPARATOR);
    }
}