org.boon.Exceptions.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.boon.Exceptions.printStackTrace()方法的一些代码示例,展示了Exceptions.printStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Exceptions.printStackTrace()方法的具体详情如下:
包路径:org.boon.Exceptions
类名称:Exceptions
方法名:printStackTrace

Exceptions.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: boonproject/boon

public void printStackTrace( CharBuf charBuf) {
  charBuf.puts("MESSAGE:", this.getMessage());
  if (this.getRootCause() !=null) {
    charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage());
  } else if (this.getCause()!=null) {
    charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage());
  }
  StackTraceElement[] stackTrace = this.getFilteredStackTrace();
  if (stackTrace.length > 0) {
    charBuf.indent(5).addLine("This happens around this area in your code.");
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  if ( getRootCause() != null ) {
    charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName());
    stackTrace = this.getRootCause().getStackTrace();
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine();
  StringWriter writer = new StringWriter();
  super.printStackTrace( new PrintWriter(writer) );
  charBuf.add(writer);
  charBuf.addLine().multiply('-', 50).addLine();
}

代码示例来源:origin: boonproject/boon

public void printStackTrace( CharBuf charBuf) {
  charBuf.puts("MESSAGE:", this.getMessage());
  if (this.getRootCause() !=null) {
    charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage());
  } else if (this.getCause()!=null) {
    charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage());
  }
  StackTraceElement[] stackTrace = this.getFilteredStackTrace();
  if (stackTrace.length > 0) {
    charBuf.indent(5).addLine("This happens around this area in your code.");
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  if ( getRootCause() != null ) {
    charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName());
    stackTrace = this.getRootCause().getStackTrace();
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine();
  StringWriter writer = new StringWriter();
  super.printStackTrace( new PrintWriter(writer) );
  charBuf.add(writer);
  charBuf.addLine().multiply('-', 50).addLine();
}

代码示例来源:origin: io.fastjson/boon

public void printStackTrace( CharBuf charBuf) {
  charBuf.puts("MESSAGE:", this.getMessage());
  if (this.getRootCause() !=null) {
    charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage());
  } else if (this.getCause()!=null) {
    charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage());
  }
  StackTraceElement[] stackTrace = this.getFilteredStackTrace();
  if (stackTrace.length > 0) {
    charBuf.indent(5).addLine("This happens around this area in your code.");
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  if ( getRootCause() != null ) {
    charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName());
    stackTrace = this.getRootCause().getStackTrace();
    Exceptions.printStackTrace(charBuf, stackTrace);
  }
  charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine();
  StringWriter writer = new StringWriter();
  super.printStackTrace( new PrintWriter(writer) );
  charBuf.add(writer);
  charBuf.addLine().multiply('-', 50).addLine();
}

相关文章