X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fruntime%2FRuntimeModule.java;h=4893f684084a0479d48f241c35ddd21a3a9bbdc5;hp=5ae73c41240700f44662e1b70f6851487752b290;hb=0861b325fcbbfa8c5985f1e11cfc39154a3808d1;hpb=edb5c89575392565d23dbfc7083617c981048c1e diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/runtime/RuntimeModule.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/runtime/RuntimeModule.java index 5ae73c412..4893f6840 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/runtime/RuntimeModule.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/runtime/RuntimeModule.java @@ -13,6 +13,8 @@ import org.simantics.scl.compiler.environment.Environment; import org.simantics.scl.compiler.environment.GlobalOnlyEnvironment; import org.simantics.scl.compiler.internal.codegen.types.JavaTypeTranslator; import org.simantics.scl.compiler.internal.codegen.utils.JavaNamingPolicy; +import org.simantics.scl.compiler.internal.codegen.utils.LoggingOutputStream; +import org.simantics.scl.compiler.internal.codegen.utils.LoggingOutputStream.LogLevel; import org.simantics.scl.compiler.internal.codegen.utils.TransientClassBuilder; import org.simantics.scl.compiler.internal.decompilation.DecompilerFactory; import org.simantics.scl.compiler.internal.decompilation.IDecompiler; @@ -50,7 +52,7 @@ public class RuntimeModule { public synchronized void addClass(String name, byte[] class_) { if(TRACE_CLASS_CREATION) - System.out.println("addClass " + name + " (" + class_.length + " bytes)"); + LOGGER.info("addClass " + name + " (" + class_.length + " bytes)"); if(VALIDATE_CLASS_NAMES) validateClassName(name); localClasses.put(name, class_); @@ -59,7 +61,7 @@ public class RuntimeModule { public synchronized void addClasses(Map classes) { if(TRACE_CLASS_CREATION) for(String name : classes.keySet()) - System.out.println("addClass " + name + " (" + classes.get(name).length + " bytes)"); + LOGGER.info("addClass " + name + " (" + classes.get(name).length + " bytes)"); if(VALIDATE_CLASS_NAMES) for(String name : classes.keySet()) validateClassName(name); @@ -67,7 +69,7 @@ public class RuntimeModule { } private void validateClassName(String name) { - //System.out.println(name); + //LOGGER.info(name); /*if(!name.startsWith(SCL_PACKAGE_PREFIX) || !extractClassLoaderId(name).equals(moduleName)) throw new IllegalArgumentException("Class name " + name + " does not start with '" + SCL_PACKAGE_PREFIX + moduleName + "$'."); @@ -123,7 +125,7 @@ public class RuntimeModule { } private Class getClass(String name) throws ClassNotFoundException { - //System.out.println("getClass " + name); + //LOGGER.info("getClass " + name); // If the class is not generated from SCL, use parent class loader if(!name.startsWith(SCL_PACKAGE_PREFIX)) { @@ -169,7 +171,7 @@ public class RuntimeModule { } public Module getModule(String moduleName) { - //System.out.println("ModuleClassLoader.getModule(" + moduleName + ")"); + //LOGGER.info("ModuleClassLoader.getModule(" + moduleName + ")"); if(moduleName.equals(this.moduleName)) return module; else { @@ -203,7 +205,7 @@ public class RuntimeModule { IDecompiler decompiler = DecompilerFactory.getDecompiler(); if(decompiler == null) return; - decompiler.decompile(this, className, new OutputStreamWriter(System.out)); + decompiler.decompile(this, className, new OutputStreamWriter(new LoggingOutputStream(LOGGER, LogLevel.INFO))); } }