]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Use slf4j logger in ExperimentManager.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 7 Feb 2017 14:02:55 +0000 (16:02 +0200)
committerjsimomaa <jani.simomaa@gmail.com>
Fri, 28 Apr 2017 13:09:19 +0000 (16:09 +0300)
refs #6938

Change-Id: I6f5d2450e472aab6762bf33c2be94658ce7acc99

bundles/org.simantics.simulation/META-INF/MANIFEST.MF
bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentManager.java

index 53d5638b242daabe6e2f682d3514091163a1a2cd..f1ba40ed48468bdc5d834b193578a12c894beede 100644 (file)
@@ -12,7 +12,8 @@ Require-Bundle: org.simantics.ui;bundle-version="1.0.0",
  org.simantics.modeling.ontology;bundle-version="1.2.0",
  org.simantics.fastlz;bundle-version="1.2.1",
  org.apache.commons.compress;bundle-version="1.7.0",
- org.simantics.lz4;bundle-version="1.3.0"
+ org.simantics.lz4;bundle-version="1.3.0",
+ org.slf4j.api;bundle-version="1.7.0"
 Export-Package: org.simantics.simulation,
  org.simantics.simulation.data,
  org.simantics.simulation.experiment,
index ec56854751f55bc5d5666cb29422b6a7ff10e184..613346b1147830521336c31d7a64c761e0f6da60 100644 (file)
@@ -37,12 +37,16 @@ import org.simantics.simulation.experiment.IExperimentListener;
 import org.simantics.simulation.model.IModel;
 import org.simantics.ui.workbench.WorkbenchShutdownService;
 import org.simantics.utils.datastructures.ListenerList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Simple local ExperimentManager implementation
  */
 public class ExperimentManager implements IExperimentManager {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(ExperimentManager.class);
+
     CopyOnWriteArrayList<IExperimentManagerListener> listeners = new CopyOnWriteArrayList<IExperimentManagerListener>();
     ListenerList<IExperiment> experiments = new ListenerList<IExperiment>(IExperiment.class);
     IExperiment activeExperiment;
@@ -218,9 +222,9 @@ public class ExperimentManager implements IExperimentManager {
 
             if (!listeners.isEmpty()) {
                 // Some clients are leaking listeners. Shame on them.
-                System.err.println("ExperimentManager still contains the following listeners after disposal:");
+                LOGGER.warn("ExperimentManager still contains the following listeners after disposal:");
                 for (IExperimentManagerListener listener : listeners)
-                    System.err.println("\t" + listener);
+                    LOGGER.warn("\t" + listener);
             }
         }
     }