From d9bd742d1db13318a2e977e30bd5ee1966229e22 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Tue, 7 Feb 2017 16:02:55 +0200 Subject: [PATCH] Use slf4j logger in ExperimentManager. refs #6938 Change-Id: I6f5d2450e472aab6762bf33c2be94658ce7acc99 --- bundles/org.simantics.simulation/META-INF/MANIFEST.MF | 3 ++- .../simantics/simulation/project/ExperimentManager.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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); } } } -- 2.47.1