]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.model/src/org/simantics/browsing/ui/model/tests/InstanceOfTest.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 / tests / InstanceOfTest.java
index 70b6ecaa419854896a7d09675c1f3ea2bdd7a72e..08888911319a36b37240f600ef4e66575049f5f8 100644 (file)
@@ -7,6 +7,8 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.viewpoint.ontology.ViewpointResource;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.viewpoint.ontology.ViewpointResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A visual contribution rule test that checks whether the input content is an
 
 /**
  * A visual contribution rule test that checks whether the input content is an
@@ -17,6 +19,7 @@ import org.simantics.viewpoint.ontology.ViewpointResource;
  */
 public class InstanceOfTest implements Test {
 
  */
 public class InstanceOfTest implements Test {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(InstanceOfTest.class);
     String   bundleName;
     String   className;
     Class<?> clazz;
     String   bundleName;
     String   className;
     Class<?> clazz;
@@ -40,7 +43,7 @@ public class InstanceOfTest implements Test {
             return clazz;
         Bundle b = Platform.getBundle(bundleName);
         if (b == null) {
             return clazz;
         Bundle b = Platform.getBundle(bundleName);
         if (b == null) {
-            System.err.println(getClass() + " could not resolve class " + className + ", bundle " + bundleName + " not found in platform");
+            LOGGER.error(getClass() + " could not resolve class " + className + ", bundle " + bundleName + " not found in platform");
             failed = true;
             return null;
         }
             failed = true;
             return null;
         }
@@ -48,7 +51,7 @@ public class InstanceOfTest implements Test {
             this.clazz = b.loadClass(className);
             return clazz;
         } catch (ClassNotFoundException e) {
             this.clazz = b.loadClass(className);
             return clazz;
         } catch (ClassNotFoundException e) {
-            System.err.println(getClass() + " could not resolve class " + className + ", from bundle " + bundleName);
+            LOGGER.error(getClass() + " could not resolve class " + className + ", from bundle " + bundleName, e);
             failed = true;
             return null;
         }
             failed = true;
             return null;
         }