]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils/src/org/simantics/utils/Development.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.utils / src / org / simantics / utils / Development.java
index afaec5c32a5291c80724e0cbcfee57a9622df564..84c13b4d82973f81706ae881fe2736821f5dff1e 100644 (file)
@@ -10,9 +10,12 @@ import org.simantics.databoard.adapter.AdaptException;
 import org.simantics.databoard.binding.Binding;
 import org.simantics.databoard.binding.error.BindingException;
 import org.simantics.databoard.binding.mutable.Variant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Development {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(Development.class);
        public static TreeMap<String,Integer> histogram = new TreeMap<String,Integer>();
 
        public static final boolean DEVELOPMENT = false;
@@ -37,7 +40,7 @@ public class Development {
                                @Override
                                public void handle(Object event) {
                                        if((Boolean) getProperty(PRINT, Bindings.BOOLEAN))
-                                               System.err.println(event.toString());
+                                               LOGGER.info(event.toString());
                                }
        
                        });
@@ -95,7 +98,11 @@ public class Development {
                String key = o.toString();
                Integer i = Development.histogram.get(key);
                if(i == null) i = 0;
-               Development.histogram.put(key, i+1);
+               int newValue = i+1;
+               if (newValue == 1000) {
+                   newValue = newValue;
+               }
+               Development.histogram.put(key, newValue);
        }
        
 }