code: public List<LogEvent> getLogs(LogLevel level, boolean recurse)
      {
          List<LogEvent> levelLogs = new LinkedList<LogEvent>();
  
          for (LogEvent log : this) {
              if (log.getLevel() == level) {
                  levelLogs.add(log);
              }
  
              if (recurse && log instanceof LogTreeNode) {
                  levelLogs.addAll(((LogTreeNode) log).getLogs(level, true));
              }
          }
  
          return levelLogs;
      }
docs: Filter logs of a specific level.
  
  @param level the level of the logs to return
  @param recurse if one of the {@link LogEvent} is a node look at its children too etc.
  @return the filtered logs