]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/rules/MappedModelingRules.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / rules / MappedModelingRules.java
index a47a1b63f580a80fc94b389d2557ee50b9238c94..21a435f4ab134aa26d920d93241e113badce0487 100644 (file)
@@ -36,9 +36,12 @@ import org.simantics.structural2.modelingRules.IAttachmentRelationMap;
 import org.simantics.structural2.modelingRules.IConnectionPoint;
 import org.simantics.structural2.modelingRules.IModelingRules;
 import org.simantics.structural2.modelingRules.Policy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MappedModelingRules extends AbstractModelingRules {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(MappedModelingRules.class);
     IModelingRules baseRules;
     IMapping mapping;
 
@@ -69,7 +72,7 @@ public class MappedModelingRules extends AbstractModelingRules {
         ModelingResources MOD = ModelingResources.getInstance(g);
 
         if(Policy.DEBUG_STANDARD_MODELING_RULES)
-            System.out.println("setConnectionType(" + NameUtils.getSafeName(g, connection) + ", " + NameUtils.getSafeName(g, connectionType) + ")");
+            LOGGER.info("setConnectionType(" + NameUtils.getSafeName(g, connection) + ", " + NameUtils.getSafeName(g, connectionType) + ")");
 
         RelatedDiagramConnections rdc = new RelatedDiagramConnections(g);
         rdc.addConnection(connection);
@@ -133,12 +136,12 @@ public class MappedModelingRules extends AbstractModelingRules {
             if(cp == null)
                 throw new IllegalArgumentException("Null connection point encountered.");
             if(Policy.DEBUG_STANDARD_MODELING_RULES)
-                System.out.println("Mapping CP: " + cp.toString(g));
+                LOGGER.info("Mapping CP: " + cp.toString(g));
             int mcps = mapping.mapToConnectionPoints(g, cp, mappedConnectionPoints);
             if(mcps > 0) {
                 if(Policy.DEBUG_STANDARD_MODELING_RULES)
                     for (IConnectionPoint mcpt : mappedConnectionPoints.subList(mappedConnectionPoints.size()-mcps, mappedConnectionPoints.size()))
-                        System.out.println("Mapped CP: " + mcpt.toString(g));
+                        LOGGER.info("Mapped CP: " + mcpt.toString(g));
             } else {
                 if(cp instanceof CPTerminal) {
                     // TODO move this logic elsewhere
@@ -211,7 +214,7 @@ public class MappedModelingRules extends AbstractModelingRules {
             Resource connection) throws DatabaseException {
         Resource mappedConnection = mapping.mapConnection(g, connection);
         if(mappedConnection == null)
-            System.err.println("Connection mapped from " + NameUtils.getSafeName(g, connection, true) + " is null");
+            LOGGER.warn("Connection mapped from " + NameUtils.getSafeName(g, connection, true) + " is null");
         return new MappedAttachmentRelationMap(
                 baseRules.getAttachmentRelations(g, mappedConnection)
         );