]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.model/src/org/simantics/browsing/ui/model/nodetypes/SpecialNodeType.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.browsing.ui.model / src / org / simantics / browsing / ui / model / nodetypes / SpecialNodeType.java
index ddd6113ff57ca77ee6f0e08ca0a7f54ec4836ebf..8218bac41e2e23327e3a5fa83d0166efbbf5e618 100644 (file)
@@ -26,8 +26,13 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.ui.selection.WorkbenchSelectionElement;
 import org.simantics.viewpoint.ontology.ViewpointResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SpecialNodeType implements NodeType {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(SpecialNodeType.class);
+    
     public Resource resource;
     Class<?> contentType;
     
@@ -55,17 +60,19 @@ public class SpecialNodeType implements NodeType {
                     if (bundleId != null) {
                         bundle = Platform.getBundle(bundleId);
                         if (bundle == null)
-                            System.err.println("Referenced bundle '" + bundleId + "' not found in platform.");
+                            LOGGER.warn("Referenced bundle '" + bundleId + "' not found in platform.");
                     }
                     if (bundle != null)
                         contentType = bundle.loadClass(contentTypeName);
                     else
                         contentType = Class.forName(contentTypeName);
                 } catch (ClassNotFoundException e) {
-                    System.err.println("Unknown content type " + contentTypeName);
+                    LOGGER.error("Unknown content type {} - {}", contentTypeName, e.getMessage());
+                    if (LOGGER.isTraceEnabled())
+                        LOGGER.trace("Unknown content type {}", contentTypeName, e);
                 }
             else
-                System.err.println("Content type is NULL.");
+                LOGGER.warn("Content type is NULL.");
         }
         return new SpecialNodeType(r, contentType);
     }