Skip to content

Commit 0ce9698

Browse files
author
Rob Tjalma
authored
Merge pull request #33 from com-pas/small-logging
Added logging to show list of OCL Files found.
2 parents 3b956cd + ebb3ed8 commit 0ce9698

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

riseclipse/validator-riseclipse/src/main/java/org/lfenergy/compas/scl/validator/collector/CompasOclFileCollector.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,27 @@ public CompasOclFileCollector(String oclCustomDirectory) {
2626
@Override
2727
public List<URI> getOclFiles() {
2828
LOGGER.debug("Searching for OCL Files in classpath.");
29-
3029
var oclFiles = new ArrayList<>(getDefaultOclFilesFromClasspath());
30+
3131
if (oclCustomDirectory != null) {
3232
LOGGER.debug("Searching for OCL Files in custom directory '{}'.", oclCustomDirectory);
3333
oclFiles.addAll(getFilesFromDirectory(oclCustomDirectory, path -> path.toString().endsWith(".ocl")));
3434
}
35+
36+
logListOfFiles(oclFiles);
3537
return oclFiles;
3638
}
39+
40+
/**
41+
* Log the list of files found during startup.
42+
*
43+
* @param oclFiles The List of Files found.
44+
*/
45+
protected void logListOfFiles(ArrayList<URI> oclFiles) {
46+
if (oclFiles != null && !oclFiles.isEmpty()) {
47+
oclFiles.forEach(oclFile -> LOGGER.info("Found OCL File '{}'", oclFile));
48+
} else {
49+
LOGGER.warn("No OCL Files found!");
50+
}
51+
}
3752
}

0 commit comments

Comments
 (0)