From: Tuukka Lehtonen Date: Tue, 7 Feb 2017 14:02:55 +0000 (+0200) Subject: Use slf4j logger in ExperimentManager. X-Git-Tag: v1.28.0~83 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=de093f459f61d24818430c3928074d433d00f06b Use slf4j logger in ExperimentManager. refs #6938 Change-Id: I6f5d2450e472aab6762bf33c2be94658ce7acc99 --- diff --git a/bundles/org.simantics.simulation/META-INF/MANIFEST.MF b/bundles/org.simantics.simulation/META-INF/MANIFEST.MF index 53d5638b2..f1ba40ed4 100644 --- a/bundles/org.simantics.simulation/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.simulation/META-INF/MANIFEST.MF @@ -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, diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentManager.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentManager.java index ec5685475..613346b11 100644 --- a/bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentManager.java +++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentManager.java @@ -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 listeners = new CopyOnWriteArrayList(); ListenerList experiments = new ListenerList(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); } } }