private static void publish(Logger logger, LogRecord record) {
    // Annoyingly this method appears to copy the array every time it is called, but there's
    // nothing much we can do about this (and there could be synchronization issues even if we
    // could access things directly because handlers can be changed at any time). Most of the
    // time this returns the singleton empty array however, so it's not as bad as all that.
    for (Handler handler : logger.getHandlers()) {
      handler.publish(record);
    }
    if (logger.getUseParentHandlers()) {
      logger = logger.getParent();
      if (logger != null) {
        publish(logger, record);
      }
    }
  }
private static void publish ( Logger logger , LogRecord record ) { for ( Handler handler : logger . getHandlers ( ) ) { handler . publish ( record ) ; } if ( logger . getUseParentHandlers ( ) ) { logger = logger . getParent ( ) ; if ( logger != null ) { publish ( logger , record ) ; } } }
rate limiting. Thus we don't have to care about using iterative methods vs recursion here.