protected static void setFileHandlerLevel(Handler handler, Level newLevel) { if (handler instanceof FileHandler) { handler.setLevel(newLevel); } else if (handler instanceof CompositeHandler) { setFileHandlerLevel(((CompositeHandler) handler).getHandlers(), newLevel); } else if (handler instanceof DelegatingHandler) { setFileHandlerLevel(((DelegatingHandler) handler).getBaseHandler(), newLevel); } else { // } }
public static void setFileHandlerLevel(Logger logger, Level newLevel) { logger.setLevel(newLevel); Handler[] handlers = logger.getHandlers(); setFileHandlerLevel(handlers, newLevel); }
protected static void setFileHandlerLevel(Handler[] handlers, Level newLevel) { for (Handler handler : handlers) { setFileHandlerLevel(handler, newLevel); } }