Logger fixes after merge commit:fdbe8762 14/114/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 30 Sep 2016 09:23:53 +0000 (12:23 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 30 Sep 2016 09:35:47 +0000 (12:35 +0300)
refs #6724

Change-Id: I4559a65783b104aadbf8a5797aa6b3edbe128fea
(cherry picked from commit a0b1831418eba8870ca849ef2cd85823aa7bfa0a)

bundles/org.simantics.diagram/META-INF/MANIFEST.MF
bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java

index 6f879b7ed9dfd336865b188357cbed59642c9471..1ff8d39e0c760de9d7255648d7da777b20fda391 100644 (file)
@@ -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,
index aa50762782398a452ff6cb8116e61592d62d9d53..5bd73f97a463b74f0ecb4f84842ac454a903212d 100644 (file)
@@ -23,7 +23,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;\r
 import org.eclipse.jface.viewers.StructuredSelection;\r
 import org.eclipse.ui.IWorkbenchPartSite;\r
-import org.simantics.Logger;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.diagram.elements.AdaptableImmutableProxyElement;\r
 import org.simantics.g2d.canvas.ICanvasContext;\r
@@ -35,10 +34,12 @@ import org.simantics.g2d.diagram.participant.Selection;
 import org.simantics.g2d.element.ElementHints;\r
 import org.simantics.g2d.element.IElement;\r
 import org.simantics.ui.selection.WorkbenchSelectionUtils;\r
-import org.simantics.utils.datastructures.hints.IHintObservable;\r
 import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
+import org.simantics.utils.datastructures.hints.IHintObservable;\r
 import org.simantics.utils.threads.IThreadWorkQueue;\r
 import org.simantics.utils.threads.ThreadUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
 \r
 /**\r
  * A canvas participant that listens to the #0 mouse selection and provides it\r
@@ -48,6 +49,8 @@ import org.simantics.utils.threads.ThreadUtils;
  */\r
 public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implements IPostSelectionProvider, ElementJSON {\r
 \r
+    private static final Logger LOGGER = LoggerFactory.getLogger(WorkbenchSelectionProvider.class);\r
+\r
     private static final long                                 POST_SELECTION_DELAY = 300;\r
 \r
     @Dependency protected Selection selection;\r
@@ -216,7 +219,7 @@ public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implem
         try {\r
             return Optional.ofNullable( WorkbenchSelectionUtils.getPossibleJSON(sel) );\r
         } catch (DatabaseException e) {\r
-            Logger.defaultLogError(e);\r
+            LOGGER.error("Unexpected failure while constructing JSON from element " + element, e);\r
             return Optional.empty();\r
         }\r
     }\r