Interface StackTracePrinter

All Known Implementing Classes:
StandardStackTracePrinter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface StackTracePrinter
Interface that can be used to print the stack trace of a Throwable.
Since:
3.5.0
Author:
Phillip Webb
See Also:
  • Method Details

    • printStackTraceToString

      default String printStackTraceToString(Throwable throwable)
      Return a String containing the printed stack trace for a given Throwable.
      Parameters:
      throwable - the throwable that should have its stack trace printed
      Returns:
      the stack trace string
    • printStackTrace

      void printStackTrace(Throwable throwable, Appendable out) throws IOException
      Prints a stack trace for the given Throwable.
      Parameters:
      throwable - the throwable that should have its stack trace printed
      out - the destination to write output
      Throws:
      IOException - on IO error