]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / utils / NodeUtil.java
index 9439369a5927a89b9cfb714f15a296ef1c0ed678..5dac6fd2a59b68bc380fddbdbdda71efc5fd74f5 100644 (file)
@@ -54,6 +54,8 @@ import org.simantics.scl.runtime.function.Function1;
 import org.simantics.scl.runtime.function.FunctionImpl1;
 import org.simantics.utils.datastructures.Pair;
 import org.simantics.utils.threads.IThreadWorkQueue;
 import org.simantics.scl.runtime.function.FunctionImpl1;
 import org.simantics.utils.datastructures.Pair;
 import org.simantics.utils.threads.IThreadWorkQueue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Utilities for debugging/printing the contents of a scenegraph.
 
 /**
  * Utilities for debugging/printing the contents of a scenegraph.
@@ -62,6 +64,7 @@ import org.simantics.utils.threads.IThreadWorkQueue;
  */
 public final class NodeUtil {
 
  */
 public final class NodeUtil {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(NodeUtil.class);
     /**
      * @param <T>
      */
     /**
      * @param <T>
      */
@@ -607,7 +610,7 @@ public final class NodeUtil {
             } else {
 
                 if(pc.length > 0) {
             } else {
 
                 if(pc.length > 0) {
-                    System.err.println("Method " + setter.getName() + " expects " + pc[0].getCanonicalName() + " (got " + value.getClass().getCanonicalName() + ").");
+                    LOGGER.warn("Method " + setter.getName() + " expects " + pc[0].getCanonicalName() + " (got " + value.getClass().getCanonicalName() + ").");
                 }
 
             }
                 }
 
             }
@@ -936,7 +939,7 @@ public final class NodeUtil {
             // Find node transform..
             AffineTransform transform = getGlobalToLocalTransform(node, null);
             if (transform == null) {
             // Find node transform..
             AffineTransform transform = getGlobalToLocalTransform(node, null);
             if (transform == null) {
-                System.err.println("WARNING: Non-invertible transform for node: " + node);
+                LOGGER.warn("WARNING: Non-invertible transform for node: " + node);
                 return event;
             }
             MouseEvent me = (MouseEvent)event;
                 return event;
             }
             MouseEvent me = (MouseEvent)event;
@@ -975,7 +978,7 @@ public final class NodeUtil {
 
                     if(DEBUG_BOUNDS) {
                         for(int i=0;i<indent;i++) System.err.print(" ");
 
                     if(DEBUG_BOUNDS) {
                         for(int i=0;i<indent;i++) System.err.print(" ");
-                        System.err.println("+getLocalBoundsImpl " + next  + " => " + bl);
+                        LOGGER.warn("+getLocalBoundsImpl " + next  + " => " + bl);
                     }
 
                     if(bl != null) {
                     }
 
                     if(bl != null) {
@@ -989,7 +992,7 @@ public final class NodeUtil {
 
                 if(DEBUG_BOUNDS) {
                     for(int i=0;i<indent;i++) System.err.print(" ");
 
                 if(DEBUG_BOUNDS) {
                     for(int i=0;i<indent;i++) System.err.print(" ");
-                    System.err.println("=getLocalBoundsImpl " + node  + " => " + bounds);
+                    LOGGER.warn("=getLocalBoundsImpl " + node  + " => " + bounds);
                 }
 
                 return bounds;
                 }
 
                 return bounds;
@@ -998,7 +1001,7 @@ public final class NodeUtil {
                 if(result != null) {
                     if(DEBUG_BOUNDS) {
                         for(int i=0;i<indent;i++) System.err.print(" ");
                 if(result != null) {
                     if(DEBUG_BOUNDS) {
                         for(int i=0;i<indent;i++) System.err.print(" ");
-                        System.err.println("=getLocalBoundsImpl " + node  + " => " + result);
+                        LOGGER.warn("=getLocalBoundsImpl " + node  + " => " + result);
                     }
                     return result;
                 }
                     }
                     return result;
                 }