Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.classic.html;
public class DefaultThrowableRenderer implements
  static final String TRACE_PREFIX = "<br />&nbsp;&nbsp;&nbsp;&nbsp;";
  public void render(StringBuilder sbufILoggingEvent event) {
    IThrowableProxy tp = event.getThrowableProxy();
    sbuf.append("<tr><td class=\"Exception\" colspan=\"6\">");
    while (tp != null) {
      render(sbuftp);
      tp = tp.getCause();
    }
    sbuf.append("</td></tr>");
  }
  void render(StringBuilder sbufIThrowableProxy tp) {
    printFirstLine(sbuftp);
    
    int commonFrames = tp.getCommonFrames();
    
    for (int i = 0; i < stepArray.length - commonFramesi++) {
      StackTraceElementProxy step = stepArray[i];
      sbuf.append();
      sbuf.append(Transform.escapeTags(step.toString()));
    }
    
    if (commonFrames > 0) {
      sbuf.append();
      sbuf.append("\t... " + commonFrames).append(" common frames omitted")
          .append(.);
    }
  }
  public void printFirstLine(StringBuilder sbIThrowableProxy tp) {
    int commonFrames = tp.getCommonFrames();
    if (commonFrames > 0) {
      sb.append("<br />").append(.);
    }
    sb.append(tp.getClassName()).append(": ").append(
        Transform.escapeTags(tp.getMessage()));
  }
New to GrepCode? Check out our FAQ X