void () { File logDirectory = BuildManager.getBuildLogDirectory(); File[] files = logDirectory.listFiles(file -> file.getName().endsWith(".log")); if (files == null || files.length == 0) { LOG.debug("No *.log files in " + logDirectory + " after build"); return; } Arrays.sort(files, Comparator.comparing(File::getName)); for (File file : files) { LOG.debug(file.getName() + ":"); try { List<String> lines = FileUtil.loadLines(file); for (String line : lines) { LOG.debug(line); } } catch (IOException e) { LOG.debug("Failed to load contents: " + e.getMessage()); } } }