Trace level logging for compilation status in SCLOsgi.compileAllModules 02/3802/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 21 Jan 2020 11:10:36 +0000 (13:10 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 21 Jan 2020 11:10:36 +0000 (13:10 +0200)
gitlab #448

Change-Id: Ie23faa3474f42e8361e64ed0f84ad24c2ce18aee

bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/SCLOsgi.java

index 2e717f945780574f71c3382c33cb3bf157fa55e2..90876bbdf229747a06e400e15fe35c441677f2a1 100644 (file)
@@ -13,12 +13,16 @@ import org.simantics.scl.compiler.testing.repository.TestRepository;
 import org.simantics.scl.osgi.internal.Activator;
 import org.simantics.scl.osgi.internal.ServiceBasedModuleSourceRepository;
 import org.simantics.scl.osgi.internal.ServiceBasedTestRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import gnu.trove.procedure.TObjectProcedure;
 
 
 public class SCLOsgi {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(SCLOsgi.class);
+
     private SCLOsgi() {}
     
     public static ModuleSourceRepository SOURCE_REPOSITORY = new ServiceBasedModuleSourceRepository(Activator.getContext());
@@ -38,21 +42,19 @@ public class SCLOsgi {
             }
         });
     }
-    
+
     public static String compileAllModules() {
         ArrayList<String> modulesWithErrors = new ArrayList<String>(); 
         SCLOsgi.SOURCE_REPOSITORY.forAllModules(new TObjectProcedure<String>() {
             @Override
             public boolean execute(String moduleName) {
-                System.out.print(moduleName);
-                System.out.print(" - ");
                 Failable<Module> module = SCLOsgi.MODULE_REPOSITORY.getModule(moduleName);
                 if(module.didSucceed())
-                    System.out.println("succeeded");
+                    LOGGER.trace("{} - {}", moduleName, "succeeded");
                 else if(module == DoesNotExist.INSTANCE)
-                    System.out.println("does not exist"); // should not happen
+                    LOGGER.trace("{} - {}", moduleName, "does not exist"); // should not happen
                 else {
-                    System.out.println("error");
+                    LOGGER.trace("{} - {}", moduleName, "error");
                     modulesWithErrors.add(moduleName);
                 }
                 return true;