]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/lru/ClusterLRU.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / lru / ClusterLRU.java
index ecc016723a6000f12bfec0e1dad9697d633c625d..e94abf7f208379efbc739a212a7338a545e5babe 100644 (file)
@@ -15,12 +15,15 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.impl.ClusterBase;
 import org.simantics.db.impl.ClusterI;
 import org.simantics.db.service.ClusterUID;
+import org.slf4j.LoggerFactory;
 
 import gnu.trove.map.hash.TIntIntHashMap;
 
 
 public class ClusterLRU extends LRU<ClusterUID, ClusterInfo> {
 
+    private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ClusterLRU.class);
+    
        final private BijectionMap<ClusterUID, Integer> clusterMapping = new BijectionMap<ClusterUID, Integer>();
        
        public ClusterLRU(ClusterManager manager, String identifier, Path writeDir) {
@@ -284,7 +287,7 @@ public class ClusterLRU extends LRU<ClusterUID, ClusterInfo> {
                                                        synchronized(map) {
                                                                value = map.get(key);
                                                                if(key != value) {
-                                                                       System.err.println("Read failed for real " + key + " vs. " + value);
+                                                                       LOGGER.warn("Read failed for real " + key + " vs. " + value);
                                                                }
                                                                //ws.release();
                                                        }
@@ -302,9 +305,10 @@ public class ClusterLRU extends LRU<ClusterUID, ClusterInfo> {
                write.join();
                read.join();
                
-               long duration = System.nanoTime() - start;
-               System.err.println("took " + 1e-9*duration + "s.");
-               
+               if (LOGGER.isDebugEnabled()) {
+                   long duration = System.nanoTime() - start;
+                   LOGGER.debug("took " + 1e-9*duration + "s.");
+               }
        }
        
 }