operator/src/test/java/oracle/kubernetes/utils/TestUtils.java
public static List<Handler> removeConsoleHandlers(Logger logger) {
    List<Handler> savedHandlers = new ArrayList<>();
    for (Handler handler : logger.getHandlers()) {
      if (handler instanceof ConsoleHandler) {
        savedHandlers.add(handler);
      }
    }
    for (Handler handler : savedHandlers) {
      logger.removeHandler(handler);
    }
    return savedHandlers;
  }
/**
   * Removes the console handlers from the specified logger, in order to silence them during a test.
   *
   * @param logger a logger to silence
   * @return a collection of the removed handlers
   */
Removes the console handlers from the specified logger, in order to silence them during a test.
@param logger a logger to silence
@return a collection of the removed handlers
Removes the console handlers from the specified logger in order to silence them during a test . @param logger a logger to silence @return a collection of the removed handlers
public static List<Handler> removeConsoleHandlers(Logger logger) {
    List<Handler> savedHandlers = new ArrayList<>();
    for (Handler handler : logger.getHandlers()) {
      if (handler instanceof ConsoleHandler) {
        savedHandlers.add(handler);
      }
    }
    for (Handler handler : savedHandlers) {
      logger.removeHandler(handler);
    }
    return savedHandlers;
  }
public static List < Handler > removeConsoleHandlers ( Logger logger ) { List < Handler > savedHandlers = new ArrayList < > ( ) ; for ( Handler handler : logger . getHandlers ( ) ) { if ( handler instanceof ConsoleHandler ) { savedHandlers . add ( handler ) ; } } for ( Handler handler : savedHandlers ) { logger . removeHandler ( handler ) ; } return savedHandlers ; }
Removes the console handlers from the specified logger, in order to silence them during a test.
Removes the console handlers from the specified logger in order to silence them during a test .