]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Replaces stdout/stderr by logging in certain places 51/251/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 3 Jan 2017 11:13:34 +0000 (13:13 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 5 Jan 2017 07:10:59 +0000 (09:10 +0200)
refs #6938

Change-Id: I88f7b5459884d2eddb2624e45d4e1fddedbd5b0c

bundles/org.simantics.acorn/META-INF/MANIFEST.MF
bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java
bundles/org.simantics.graph.db/META-INF/MANIFEST.MF
bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java

index 9152acafd81bca244dc924c6c94350fc07b0730b..28c851cb0cb291105ea0a5541922695b5db7ba76 100644 (file)
@@ -11,7 +11,8 @@ Require-Bundle: gnu.trove3;bundle-version="3.0.0",
  org.simantics.compressions;bundle-version="1.0.0",
  org.simantics.backup,
  org.eclipse.core.runtime;bundle-version="3.11.1",
  org.simantics.compressions;bundle-version="1.0.0",
  org.simantics.backup,
  org.eclipse.core.runtime;bundle-version="3.11.1",
- org.simantics.db.procore
+ org.simantics.db.procore,
+ org.slf4j.api;bundle-version="1.7.2"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Bundle-Activator: org.simantics.acorn.internal.Activator
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
 Bundle-Activator: org.simantics.acorn.internal.Activator
index b2a30953cca9e0bff26e72dc69a788139e52a817..c414dd2b601a834a1de15d55be218535721b349d 100644 (file)
@@ -35,8 +35,12 @@ import org.simantics.db.service.ClusterSetsSupport;
 import org.simantics.db.service.ClusterUID;
 import org.simantics.utils.threads.logger.ITask;
 import org.simantics.utils.threads.logger.ThreadLogger;
 import org.simantics.db.service.ClusterUID;
 import org.simantics.utils.threads.logger.ITask;
 import org.simantics.utils.threads.logger.ThreadLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ClusterManager {
 
 public class ClusterManager {
+    
+    final static Logger LOGGER = LoggerFactory.getLogger(ClusterManager.class); 
 
        private ArrayList<String> currentChanges = new ArrayList<String>();
 
 
        private ArrayList<String> currentChanges = new ArrayList<String>();
 
@@ -148,7 +152,7 @@ public class ClusterManager {
                    return false;
                }
     
                    return false;
                }
     
-               System.err.println("makeSnapshot");
+               LOGGER.info("makeSnapshot");
     
                // Schedule writing of all data to disk
             refreshHeadState();
     
                // Schedule writing of all data to disk
             refreshHeadState();
@@ -173,7 +177,7 @@ public class ClusterManager {
     
                amountOfFiles = countFiles(workingDirectory);
                
     
                amountOfFiles = countFiles(workingDirectory);
                
-               System.err.println(" -finished: amount of files is " + amountOfFiles);
+               LOGGER.info(" -finished: amount of files is {}", amountOfFiles);
     
                workingDirectory = dbFolder.resolve(Integer.toString(mainState.headDir));
                if (!Files.exists(workingDirectory)) {
     
                workingDirectory = dbFolder.resolve(Integer.toString(mainState.headDir));
                if (!Files.exists(workingDirectory)) {
index 20c651f5c7540592c90a402c9504ca6d1c9c2c30..f21b3e776dd1dd7cd981113b6da07374c1b9c9f4 100644 (file)
@@ -7,7 +7,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Require-Bundle: org.simantics.graph;bundle-version="1.0.0";visibility:=reexport,
  org.simantics.db.common;bundle-version="0.8.0",
  gnu.trove3;bundle-version="3.0.3",
 Require-Bundle: org.simantics.graph;bundle-version="1.0.0";visibility:=reexport,
  org.simantics.db.common;bundle-version="0.8.0",
  gnu.trove3;bundle-version="3.0.3",
- org.simantics.layer0;bundle-version="1.0.0"
+ org.simantics.layer0;bundle-version="1.0.0",
+ org.slf4j.api;bundle-version="1.7.2"
 Export-Package: org.simantics.graph.db,
  org.simantics.graph.db.old
 Bundle-Vendor: VTT Technical Research Centre of Finland
 Export-Package: org.simantics.graph.db,
  org.simantics.graph.db.old
 Bundle-Vendor: VTT Technical Research Centre of Finland
index edcbc51d86499597619ee29b504de0bd087f2d19..bdfd3de6e2ae326ad739468ac913f1f58fcbe274 100644 (file)
@@ -62,11 +62,14 @@ import org.simantics.graph.representation.Identity;
 import org.simantics.graph.representation.TransferableGraph1;
 import org.simantics.graph.representation.Value;
 import org.simantics.utils.datastructures.BinaryFunction;
 import org.simantics.graph.representation.TransferableGraph1;
 import org.simantics.graph.representation.Value;
 import org.simantics.utils.datastructures.BinaryFunction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import gnu.trove.list.array.TIntArrayList;
 import gnu.trove.map.hash.TObjectIntHashMap;
 
 public class TransferableGraphs {
 
 import gnu.trove.list.array.TIntArrayList;
 import gnu.trove.map.hash.TObjectIntHashMap;
 
 public class TransferableGraphs {
+    final static Logger LOGGER = LoggerFactory.getLogger(TransferableGraphs.class); 
 
        public static long[] importGraph(Session session, Object tg, IImportAdvisor advisor) throws DatabaseException, TransferableGraphException {
                if (tg instanceof TransferableGraph1) 
 
        public static long[] importGraph(Session session, Object tg, IImportAdvisor advisor) throws DatabaseException, TransferableGraphException {
                if (tg instanceof TransferableGraph1) 
@@ -579,7 +582,7 @@ public class TransferableGraphs {
                });
 
                long end = System.nanoTime();
                });
 
                long end = System.nanoTime();
-               System.err.println("Wrote transferable graph in " + 1e-9*(end-start) + " seconds.");
+               LOGGER.info("Wrote transferable graph in {} seconds.", 1e-9*(end-start));
        }
 
        public static TransferableGraph1 create(ReadGraph graph, TransferableGraphSource source) throws DatabaseException {
        }
 
        public static TransferableGraph1 create(ReadGraph graph, TransferableGraphSource source) throws DatabaseException {