code: public static void logThreads(
        final Logger logger, final Level level, final String prefix,
        final String threadPrefix, final String stackElementPrefix) {
  
      if (logger.isLoggable(level)) {
        logger.log(level, getFormattedThreadList(prefix, threadPrefix, stackElementPrefix));
      }
    }
docs: Logs the currently active threads and their stack trace to the given Logger and Level.
  
  @param logger             the Logger instance to log to.
  @param level              the Level to log into.
  @param prefix             a prefix of the log message.
  @param threadPrefix       logged before each thread, e.g. "\n\t" to create an indented list.
  @param stackElementPrefix logged before each stack trace element, e.g. "\n\t\t" to create an indented list.