Class SuccinctStackTraceFormatter


  • public class SuccinctStackTraceFormatter
    extends java.lang.Object
    Formats a stack trace in a single line. The format is meant to convey the stack trace as a sequence of class names and line numbers, with the topmost frame first, suitable for logging. Beware, the format may evolve.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Throwable big()  
      static java.lang.String format​(java.lang.Throwable t)
      Formats a Throwable's stack trace.
      static java.lang.String formatWithDescription​(java.lang.Throwable t, java.lang.String description)
      Formats a Throwable and adds an optional description string.
      static java.lang.Throwable little()  
      static void main​(java.lang.String[] args)  
      static void printStackTrace​(java.lang.Throwable t)  
      static void printStackTrace​(java.lang.Throwable t, java.io.PrintStream out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SuccinctStackTraceFormatter

        public SuccinctStackTraceFormatter()
    • Method Detail

      • formatWithDescription

        public static java.lang.String formatWithDescription​(java.lang.Throwable t,
                                                             java.lang.String description)
        Formats a Throwable and adds an optional description string. The string should be suitable to precede the top stack element, and include any punctuation that should differentiate it from the element.
      • format

        public static java.lang.String format​(java.lang.Throwable t)
        Formats a Throwable's stack trace. The format is meant to be a single line of output, conveying the stack trace as a sequence of class names and line numbers, with the topmost frame first, suitable for logging. If two adjacent stack trace elements share some portion of a class name, the bottommost element may have the common part replaced with an ampersand.
      • printStackTrace

        public static void printStackTrace​(java.lang.Throwable t)
      • printStackTrace

        public static void printStackTrace​(java.lang.Throwable t,
                                           java.io.PrintStream out)
      • main

        public static final void main​(java.lang.String[] args)
      • big

        public static final java.lang.Throwable big()
      • little

        public static final java.lang.Throwable little()