From: Tuukka Lehtonen Date: Tue, 21 Jan 2020 11:10:36 +0000 (+0200) Subject: Trace level logging for compilation status in SCLOsgi.compileAllModules X-Git-Tag: v1.43.0~122 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=6c68b80324f1e7d8fcedd2ff9f341b7eced1ee40;p=simantics%2Fplatform.git Trace level logging for compilation status in SCLOsgi.compileAllModules gitlab #448 Change-Id: Ie23faa3474f42e8361e64ed0f84ad24c2ce18aee --- diff --git a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/SCLOsgi.java b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/SCLOsgi.java index 2e717f945..90876bbdf 100644 --- a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/SCLOsgi.java +++ b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/SCLOsgi.java @@ -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 modulesWithErrors = new ArrayList(); SCLOsgi.SOURCE_REPOSITORY.forAllModules(new TObjectProcedure() { @Override public boolean execute(String moduleName) { - System.out.print(moduleName); - System.out.print(" - "); Failable 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;