X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.commands%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcommands%2Finternal%2Fserialization%2FCommandSerializerFactory.java;h=70d2ad6a24f05e93bd8d1595f43421e9badde771;hp=6f24e7d71b54d8323f79341741c218e4aafd8f37;hb=1dfeb7d5c49b1391cd9d877e1eddab18995cb151;hpb=c13c4179bda758e77fe1f2032d3c4268bb9e3120 diff --git a/bundles/org.simantics.scl.commands/src/org/simantics/scl/commands/internal/serialization/CommandSerializerFactory.java b/bundles/org.simantics.scl.commands/src/org/simantics/scl/commands/internal/serialization/CommandSerializerFactory.java index 6f24e7d71..70d2ad6a2 100644 --- a/bundles/org.simantics.scl.commands/src/org/simantics/scl/commands/internal/serialization/CommandSerializerFactory.java +++ b/bundles/org.simantics.scl.commands/src/org/simantics/scl/commands/internal/serialization/CommandSerializerFactory.java @@ -8,8 +8,11 @@ import org.simantics.scl.compiler.top.SCLExpressionCompilationException; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.runtime.function.Function; import org.simantics.scl.runtime.function.Function2; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CommandSerializerFactory { + private static final Logger LOGGER = LoggerFactory.getLogger(CommandSerializerFactory.class); @SuppressWarnings("unchecked") public static CommandSerializer create(String name, Type[] parameterTypes) { Function2[] stringConverters = new Function[parameterTypes.length]; @@ -17,12 +20,12 @@ public class CommandSerializerFactory { try { stringConverters[i] = StringConverterFactory.stringConverterFor(parameterTypes[i]); } catch(SCLExpressionCompilationException e) { - System.err.println("Failed to create a string converter for type " + parameterTypes[i] + "."); - System.err.println(CompilationErrorFormatter.toString(e.getErrors())); + LOGGER.error("Failed to create a string converter for type " + parameterTypes[i] + "."); + LOGGER.error(CompilationErrorFormatter.toString(e.getErrors()), e); return new ErrorSerializer(name); } catch (ImportFailureException e) { - System.err.println("Failed to create a string converter for type " + parameterTypes[i] + "."); - System.err.println("Didn't find Simantics/GShow/gshow."); + LOGGER.error("Failed to create a string converter for type " + parameterTypes[i] + "."); + LOGGER.error("Didn't find Simantics/GShow/gshow.", e); return new ErrorSerializer(name); } }