X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FDependenciesRelation.java;fp=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FDependenciesRelation.java;h=333f3771c843c636e2838b51b0d32488edf6e7fa;hp=a3e19f1fc7d94c2af38e01f003e368df7965335d;hb=8b8630b93f8e4ec88a8a4eb53b55031407deedc0;hpb=0242b51bcb69c03ea15aa785abc39ed70c9dbbd7 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java index a3e19f1fc..333f3771c 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/DependenciesRelation.java @@ -40,7 +40,6 @@ import org.simantics.db.common.request.ReadRequest; import org.simantics.db.common.request.SuperTypeString; import org.simantics.db.common.request.TypeString; import org.simantics.db.common.request.UnaryRead; -import org.simantics.db.common.utils.Logger; import org.simantics.db.common.utils.NameUtils; import org.simantics.db.event.ChangeListener; import org.simantics.db.exception.DatabaseException; @@ -62,9 +61,11 @@ import org.simantics.layer0.Layer0; import org.simantics.operation.Layer0X; import org.simantics.utils.datastructures.Pair; import org.simantics.utils.logging.TimeLogger; +import org.slf4j.LoggerFactory; public class DependenciesRelation extends UnsupportedRelation implements GenericRelationIndex { + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DependenciesRelation.class); private static final boolean DEBUG = false; static final boolean DEBUG_LISTENERS = false; private static final boolean PROFILE = false; @@ -112,7 +113,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic @Override public void exception(AsyncReadGraph graph, Throwable throwable) { - Logger.defaultLogError(throwable); + LOGGER.error("Could not compile possible related value for resource {}", resource, throwable); } }); @@ -126,7 +127,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic @Override public void exception(AsyncReadGraph graph, Throwable throwable) { - Logger.defaultLogError(throwable); + LOGGER.error("Could not find type for resource {}", resource, throwable); } }; @@ -150,7 +151,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic @Override public void exception(AsyncReadGraph graph, Throwable throwable) { - Logger.defaultLogError(throwable); + LOGGER.error("Could not compile for resource {}", resource, throwable); } }); @@ -171,7 +172,7 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic if(typeString == null) { typeString = graph.syncRequest(new SuperTypeString(e.principalType)); if (typeString.isEmpty()) { - Logger.defaultLogError(new DatabaseException("No name for type " + NameUtils.getURIOrSafeNameInternal(graph, e.resource) + " (" + e.resource + ")")); + LOGGER.error("No name for type", new DatabaseException("No name for type " + NameUtils.getURIOrSafeNameInternal(graph, e.resource) + " (" + e.resource + ")")); } typeStrings.put(e.principalType, typeString); } @@ -507,9 +508,8 @@ public class DependenciesRelation extends UnsupportedRelation implements Generic } catch (Throwable t) { // Just to know if something unexpected happens here. - Logger.defaultLogError("Dependencies index update failed for model " - + model + " and relation " + resource + ".", t); - t.printStackTrace(); + LOGGER.error("Dependencies index update failed for model " + + model + " and relation " + resource + ".", t); // NOTE: Last resort: failure to update index // properly results in removal of the whole index.