From 1012b16d840ecac721ed513a2cf6d03936aab969 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Fri, 24 Nov 2023 14:13:39 +0100
Subject: [PATCH] Suppress ClassGraph DEBUG output, add option to print it

---
 src/main/java/no/nibio/vips/model/factory/ModelFactory.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/no/nibio/vips/model/factory/ModelFactory.java b/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
index 9f29305..3f5e1bd 100755
--- a/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
+++ b/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
@@ -139,10 +139,10 @@ public class ModelFactory {
             reflections = new Reflections(topDomain);
             subTypes.addAll(reflections.getSubTypesOf(Model.class));   
         }*/
-        
+        boolean verboseClassGraph = System.getProperty("no.nibio.vips.core.VERBOSE_CLASSGRAPH") != null && System.getProperty("no.nibio.vips.core.VERBOSE_CLASSGRAPH").equals("true");
         try (ScanResult scanResult =                // Assign scanResult in try-with-resources
         new ClassGraph()                    // Create a new ClassGraph instance
-            .verbose()                      // If you want to enable logging to stderr
+            .verbose(verboseClassGraph)                      // If you want to enable logging to stderr
             .enableClassInfo()            // Scan classes, methods, fields, annotations
             //.acceptPackages("com.xyz")      // Scan com.xyz and subpackages
             .scan()) {                      // Perform the scan and return a ScanResult
-- 
GitLab