]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Add logging by default to adapters exception-methods 75/1175/4
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 1 Nov 2017 07:47:14 +0000 (09:47 +0200)
committerJani Simomaa <jani.simomaa@semantum.fi>
Wed, 1 Nov 2017 08:59:11 +0000 (10:59 +0200)
refs #7581

Change-Id: I753043d4afc65318af59ff48e71485fc70b04dfe

bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/ListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java

index 0046e413d75e3173116ebbeb0b5ebaf3ae94f21c..ba655f89096402138b1e90f51e4335e0755834d9 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.procedure.AsyncListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class AsyncListenerAdapter<T> implements AsyncListener<T> {
 
     @Override
     public void exception(AsyncReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index e7cd7d6c2ba64798a294a006ae34c256c8ca7d0b..f7fee516df677999695b07f3acbf2d832263c51c 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.procedure.AsyncMultiListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class AsyncMultiListenerAdapter<T> implements AsyncMultiListener<T> {
 
     @Override
     public void exception(AsyncReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index 44bbfc02a8ff2ef306aa3bdf14a7f20d12a910f5..3cf03ed16ee3c7149f1451c778b82749f8281052 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.procedure.AsyncSetListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class AsyncSetListenerAdapter<T> implements AsyncSetListener<T> {
 
     @Override
     public void exception(AsyncReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index ab681f8ef8168be1794dccda90e56fc80db5a446..18ade0e4f83a9e0aafb4b75e80e641cfc8c856f6 100644 (file)
 package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.procedure.Listener;
+import org.slf4j.LoggerFactory;
 
 public abstract class ListenerAdapter<T> implements Listener<T> {
 
     @Override
     public void exception(Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index 3dc1a495abe2f98cfaca69be39bcf67057521f56..62b40426091b3c40ab52c60f4b44cf84fc124288 100644 (file)
  *******************************************************************************/
 package org.simantics.db.common.procedure.adapter;
 
+import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.MultiListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class MultiListenerAdapter<Result> implements MultiListener<Result> {
-    
+
     @Override
     public void execute(Result result) {
     }
     
     @Override
     public void exception(Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index 2e306927143c7108fe9d92a42cf73b831174e32e..442a73bed91f76cc6821d67027a5be673dff5131 100644 (file)
 package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.procedure.SetListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class SetListenerAdapter<T> implements SetListener<T> {
 
     @Override
     public void exception(Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index b5bdb5bca8005f89941655e68aa9d2636cc775aa..83d0d33f9c8da9dc0ddc6353aa1ba56925b16505 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.SyncListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class SyncListenerAdapter<T> implements SyncListener<T> {
 
     @Override
     public void exception(ReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index 53903b61ea128cff390dc66dd152222213924f63..830bf7be0840d53d970c4b07df84fd60451896e5 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.SyncMultiListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class SyncMultiListenerAdapter<T> implements SyncMultiListener<T> {
 
     @Override
     public void exception(ReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override
index 3d61e5bfac028c2cd622a03d6891d76dcddef3f3..57e516d2690eef902a6df537a945044d3fb888bd 100644 (file)
@@ -13,11 +13,13 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.SyncSetListener;
+import org.slf4j.LoggerFactory;
 
 public abstract class SyncSetListenerAdapter<T> implements SyncSetListener<T> {
 
     @Override
     public void exception(ReadGraph graph, Throwable t) {
+        LoggerFactory.getLogger(getClass()).error("Failed to listen", t);
     }
 
     @Override