]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.ui/src/org/simantics/ui/jobs/SessionGarbageCollectorJob.java
Replace System.err and System.out with SLF4J Logging
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / jobs / SessionGarbageCollectorJob.java
index 1805d0dab4b451f2a345715a63b4ff79138a850e..d987c344431ae39d53316f5dee9044c73eb9e748 100644 (file)
@@ -24,12 +24,15 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.util.SessionGarbageCollection;
 import org.simantics.db.service.LifecycleSupport;
 import org.simantics.utils.ui.ErrorLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Tuukka Lehtonen
  */
 public class SessionGarbageCollectorJob extends Job {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(SessionGarbageCollectorJob.class);
     private static SessionGarbageCollectorJob instance;
 
     public synchronized static SessionGarbageCollectorJob getInstance() {
@@ -133,7 +136,7 @@ public class SessionGarbageCollectorJob extends Job {
         if (TRACE) {
             if (!enabled) {
                 long t = System.currentTimeMillis();
-                System.out.println("GC disabled, not running @ " + ((double) (t - start) * 1e-3) + " seconds");
+                LOGGER.info("GC disabled, not running @ " + ((double) (t - start) * 1e-3) + " seconds");
             }
         }
         return enabled;
@@ -175,7 +178,7 @@ public class SessionGarbageCollectorJob extends Job {
 
             long begin = System.currentTimeMillis();
             if (TRACE) {
-                System.out.println("running GC @ " + ((double) (begin - start) * 1e-3) + " seconds");
+                LOGGER.info("running GC @ " + ((double) (begin - start) * 1e-3) + " seconds");
             }
 
             boolean busy = SessionGarbageCollection.gc(monitor, session, true, errorCallback);
@@ -188,7 +191,7 @@ public class SessionGarbageCollectorJob extends Job {
 
             if (TRACE)
                if(busy)
-                       System.err.println("Session GC ended busy. New quiet time is " + quietTime);
+                       LOGGER.info("Session GC ended busy. New quiet time is " + quietTime);
             
             // This quiet time might have been adjusted in GC
             interval = quietTime;
@@ -201,7 +204,7 @@ public class SessionGarbageCollectorJob extends Job {
             if (TRACE) {
                 //long end = System.currentTimeMillis();
                 //System.out.println("Session.GC " + (intermediate - begin) + "ms, System.GC " + (end-intermediate) + "ms, total " + (end - begin) + "ms");
-                System.out.println("Session.GC " + (intermediate - begin) + "ms");
+                LOGGER.info("Session.GC " + (intermediate - begin) + "ms");
             }
 
             // Reschedule after a quiet period.