Пример #1
0
 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 {
     //
   }
 }
Пример #2
0
 public static void setFileHandlerLevel(Logger logger, Level newLevel) {
   logger.setLevel(newLevel);
   Handler[] handlers = logger.getHandlers();
   setFileHandlerLevel(handlers, newLevel);
 }
Пример #3
0
 protected static void setFileHandlerLevel(Handler[] handlers, Level newLevel) {
   for (Handler handler : handlers) {
     setFileHandlerLevel(handler, newLevel);
   }
 }