code: public static String traceText(Throwable exception) {
          final StackTraceWriter writer = new StackTraceWriter();
          exception.printStackTrace(writer);
          return writer.toString();
      }
docs: Converts the stack trace of the specified {@code exception} into a {@link String}.
  This method always uses {@code '\n'} as a line delimiter, unlike
  {@link Throwable#printStackTrace(PrintWriter)} or {@link Throwables#getStackTraceAsString(Throwable)}.