]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/Constant.java
Make it possible to debug SCL compiler in production builds
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / constants / Constant.java
index b019c74705bc9c1a668496f49a4012cc5f444594..6f6d3daf3af28d4d74597c40c2ce7554ff6faa0d 100644 (file)
@@ -18,6 +18,8 @@ import org.simantics.scl.compiler.runtime.MutableClassLoader;
 import org.simantics.scl.compiler.top.SCLCompilerConfiguration;
 import org.simantics.scl.compiler.types.TVar;
 import org.simantics.scl.compiler.types.Type;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import gnu.trove.map.hash.THashMap;
 
@@ -29,6 +31,8 @@ import gnu.trove.map.hash.THashMap;
  */
 public abstract class Constant extends Val {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(Constant.class);
+
     public static boolean TRACE_REALIZATION = false;
     
     protected Type type;
@@ -102,7 +106,7 @@ public abstract class Constant extends Val {
         ModuleBuilder moduleBuilder = new ModuleBuilder(policy, builder.javaTypeTranslator);
         
         if(SCLCompilerConfiguration.TRACE_METHOD_CREATION)
-            System.out.println("Create class " + policy.getModuleClassName());
+            LOGGER.info("Create class " + policy.getModuleClassName());
         ClassBuilder classFile = new ClassBuilder(moduleBuilder, Opcodes.ACC_PUBLIC, policy.getModuleClassName(), "java/lang/Object");
         classFile.setSourceFile("_SCL_RealizedValue");
         
@@ -124,7 +128,7 @@ public abstract class Constant extends Val {
             if(valueCache != null) {
                 valueCache.put(this, result);
                 if(TRACE_REALIZATION)
-                    System.out.println("/REALIZED/ " + this + " " + getClass().getSimpleName());
+                    LOGGER.info("/REALIZED/ " + this + " " + getClass().getSimpleName());
             }
             return result;
         } catch (IllegalAccessException e) {