From: jsimomaa Date: Wed, 1 Nov 2017 07:47:14 +0000 (+0200) Subject: Add logging by default to adapters exception-methods X-Git-Tag: v1.31.0~68 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F1175%2F4;p=simantics%2Fplatform.git Add logging by default to adapters exception-methods refs #7581 Change-Id: I753043d4afc65318af59ff48e71485fc70b04dfe --- diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncListenerAdapter.java index 0046e413d..ba655f890 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncListenerAdapter.java @@ -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 implements AsyncListener { @Override public void exception(AsyncReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java index e7cd7d6c2..f7fee516d 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java @@ -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 implements AsyncMultiListener { @Override public void exception(AsyncReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java index 44bbfc02a..3cf03ed16 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java @@ -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 implements AsyncSetListener { @Override public void exception(AsyncReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/ListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/ListenerAdapter.java index ab681f8ef..18ade0e4f 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/ListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/ListenerAdapter.java @@ -12,11 +12,13 @@ package org.simantics.db.common.procedure.adapter; import org.simantics.db.procedure.Listener; +import org.slf4j.LoggerFactory; public abstract class ListenerAdapter implements Listener { @Override public void exception(Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java index 3dc1a495a..62b404260 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java @@ -11,16 +11,19 @@ *******************************************************************************/ 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 implements MultiListener { - + @Override public void execute(Result result) { } @Override public void exception(Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java index 2e3069271..442a73bed 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java @@ -12,11 +12,13 @@ package org.simantics.db.common.procedure.adapter; import org.simantics.db.procedure.SetListener; +import org.slf4j.LoggerFactory; public abstract class SetListenerAdapter implements SetListener { @Override public void exception(Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncListenerAdapter.java index b5bdb5bca..83d0d33f9 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncListenerAdapter.java @@ -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 implements SyncListener { @Override public void exception(ReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java index 53903b61e..830bf7be0 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java @@ -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 implements SyncMultiListener { @Override public void exception(ReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java index 3d61e5bfa..57e516d26 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java @@ -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 implements SyncSetListener { @Override public void exception(ReadGraph graph, Throwable t) { + LoggerFactory.getLogger(getClass()).error("Failed to listen", t); } @Override