Skip to content

Commit

Permalink
Replace INFO with FINE logging in CoverageOutputGenerator
Browse files Browse the repository at this point in the history
This reduces unconditional log spam for coverage report actions. If needed, users can configure the loglevel by wrapping the `CoverageOutputGenerator` jar into a `java_binary` with appropriate `jvmopts`.

Closes #22257.

PiperOrigin-RevId: 631849225
Change-Id: I3c656216b81f6a5920edf46e7ae1b8afe970faef
  • Loading branch information
fmeum authored and copybara-github committed May 8, 2024
1 parent 55e4164 commit 39115b9
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,19 @@ private static boolean isMetadataFile(String filename) {
private static List<File> getGcovInfoFiles(List<File> filesInCoverageDir) {
List<File> gcovFiles = getFilesWithExtension(filesInCoverageDir, GCOV_EXTENSION);
if (gcovFiles.isEmpty()) {
logger.log(Level.INFO, "No gcov info file found.");
logger.log(Level.FINE, "No gcov info file found.");
} else {
logger.log(Level.INFO, "Found " + gcovFiles.size() + " gcov info files.");
logger.log(Level.FINE, "Found " + gcovFiles.size() + " gcov info files.");
}
return gcovFiles;
}

private static List<File> getGcovJsonInfoFiles(List<File> filesInCoverageDir) {
List<File> gcovJsonFiles = getFilesWithExtension(filesInCoverageDir, GCOV_JSON_EXTENSION);
if (gcovJsonFiles.isEmpty()) {
logger.log(Level.INFO, "No gcov json file found.");
logger.log(Level.FINE, "No gcov json file found.");
} else {
logger.log(Level.INFO, "Found " + gcovJsonFiles.size() + " gcov json files.");
logger.log(Level.FINE, "Found " + gcovJsonFiles.size() + " gcov json files.");
}
return gcovJsonFiles;
}
Expand All @@ -241,7 +241,7 @@ private static List<File> getGcovJsonInfoFiles(List<File> filesInCoverageDir) {
private static File getProfdataFileOrNull(List<File> files) {
List<File> profdataFiles = getFilesWithExtension(files, PROFDATA_EXTENSION);
if (profdataFiles.isEmpty()) {
logger.log(Level.INFO, "No .profdata file found.");
logger.log(Level.FINE, "No .profdata file found.");
return null;
}
if (profdataFiles.size() > 1) {
Expand All @@ -252,7 +252,7 @@ private static File getProfdataFileOrNull(List<File> files) {
+ " .profadata files were found instead.");
return null;
}
logger.log(Level.INFO, "Found one .profdata file.");
logger.log(Level.FINE, "Found one .profdata file.");
return profdataFiles.get(0);
}

Expand All @@ -264,9 +264,9 @@ private static List<File> getTracefiles(LcovMergerFlags flags, List<File> filesI
lcovTracefiles = getFilesWithExtension(filesInCoverageDir, TRACEFILE_EXTENSION);
}
if (lcovTracefiles.isEmpty()) {
logger.log(Level.INFO, "No lcov file found.");
logger.log(Level.FINE, "No lcov file found.");
} else {
logger.log(Level.INFO, "Found " + lcovTracefiles.size() + " tracefiles.");
logger.log(Level.FINE, "Found " + lcovTracefiles.size() + " tracefiles.");
}
return lcovTracefiles;
}
Expand Down Expand Up @@ -310,7 +310,7 @@ static Coverage parseFilesSequentially(List<File> files, Parser parser) {
Coverage coverage = new Coverage();
for (File file : files) {
try {
logger.log(Level.INFO, "Parsing file " + file);
logger.log(Level.FINE, "Parsing file " + file);
List<SourceFileCoverage> sourceFilesCoverage = parser.parse(new FileInputStream(file));
for (SourceFileCoverage sourceFileCoverage : sourceFilesCoverage) {
coverage.add(sourceFileCoverage);
Expand Down

0 comments on commit 39115b9

Please sign in to comment.