code: public static Object exceptionSummary(Logger log, Throwable e) {
          if (log.isDebugEnabled()) {
              return e;
          } else {
              return e.toString();
          }
      }
docs: Returns either the given {@link Throwable} or its message, depending on the current logging context.
  
  @param log The {@link Logger} to query.
  @param e   The {@link Throwable} to return or process.
  @return The given {@link Throwable}, if {@link Logger#isDebugEnabled()} is true for log, or {@link Throwable#toString()}
  otherwise (which should output only the name of the exception).