From 9ed9faa6b31ff515bcf786a79417e508b1c8cde9 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Fri, 14 Oct 2022 10:46:42 +0300 Subject: [PATCH] Add trace logging for AbstractActionContext.stop --- .../META-INF/MANIFEST.MF | 3 ++- .../sequences/action/AbstractActionContext.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.simulation.sequences/META-INF/MANIFEST.MF b/bundles/org.simantics.simulation.sequences/META-INF/MANIFEST.MF index fd89d22fe..999915463 100644 --- a/bundles/org.simantics.simulation.sequences/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.simulation.sequences/META-INF/MANIFEST.MF @@ -6,5 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0";resolution:=optional, org.simantics.scl.osgi;bundle-version="1.0.4", - gnu.trove3;bundle-version="3.0.3" + gnu.trove3;bundle-version="3.0.3", + org.slf4j.api Export-Package: org.simantics.simulation.sequences.action diff --git a/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java b/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java index 5b5917f6a..2900fb07e 100644 --- a/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java +++ b/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java @@ -8,8 +8,13 @@ import java.util.PriorityQueue; import org.simantics.scl.runtime.SCLContext; import org.simantics.scl.runtime.function.Function1; import org.simantics.scl.runtime.tuple.Tuple0; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractActionContext implements ActionContext { + + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractActionContext.class); + public static final double TIME_TOLERANCE = 1e-6; double currentTime; @@ -70,6 +75,9 @@ public abstract class AbstractActionContext implements ActionContext { } public void stop(StopReason reason) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("stop context {}, reason={}", System.identityHashCode(this), reason, new Exception("trace")); + } stopped = true; handleStop(reason); } -- 2.47.1