From: Tuukka Lehtonen Date: Fri, 30 Sep 2016 09:23:53 +0000 (+0300) Subject: Logger fixes after merge commit:fdbe8762 X-Git-Tag: v1.25.0~78^2~1 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F113%2F1;p=simantics%2Fplatform.git Logger fixes after merge commit:fdbe8762 refs #6724 Change-Id: I4559a65783b104aadbf8a5797aa6b3edbe128fea --- diff --git a/bundles/org.simantics.diagram/META-INF/MANIFEST.MF b/bundles/org.simantics.diagram/META-INF/MANIFEST.MF index 6f879b7ed..1ff8d39e0 100644 --- a/bundles/org.simantics.diagram/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.diagram/META-INF/MANIFEST.MF @@ -44,7 +44,8 @@ Require-Bundle: org.simantics.utils.thread.swt, org.eclipse.e4.ui.model.workbench, org.eclipse.e4.ui.services, org.eclipse.e4.core.contexts, - org.eclipse.e4.ui.workbench + org.eclipse.e4.ui.workbench, + org.slf4j.api;bundle-version="1.7.20" Export-Package: org.simantics.diagram, org.simantics.diagram.adapter, org.simantics.diagram.connection, diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java index aa5076278..5bd73f97a 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java @@ -23,7 +23,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IWorkbenchPartSite; -import org.simantics.Logger; import org.simantics.db.exception.DatabaseException; import org.simantics.diagram.elements.AdaptableImmutableProxyElement; import org.simantics.g2d.canvas.ICanvasContext; @@ -35,10 +34,12 @@ import org.simantics.g2d.diagram.participant.Selection; import org.simantics.g2d.element.ElementHints; import org.simantics.g2d.element.IElement; import org.simantics.ui.selection.WorkbenchSelectionUtils; -import org.simantics.utils.datastructures.hints.IHintObservable; import org.simantics.utils.datastructures.hints.IHintContext.Key; +import org.simantics.utils.datastructures.hints.IHintObservable; import org.simantics.utils.threads.IThreadWorkQueue; import org.simantics.utils.threads.ThreadUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A canvas participant that listens to the #0 mouse selection and provides it @@ -48,6 +49,8 @@ import org.simantics.utils.threads.ThreadUtils; */ public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implements IPostSelectionProvider, ElementJSON { + private static final Logger LOGGER = LoggerFactory.getLogger(WorkbenchSelectionProvider.class); + private static final long POST_SELECTION_DELAY = 300; @Dependency protected Selection selection; @@ -216,7 +219,7 @@ public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implem try { return Optional.ofNullable( WorkbenchSelectionUtils.getPossibleJSON(sel) ); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("Unexpected failure while constructing JSON from element " + element, e); return Optional.empty(); } }