From 3af2e3009852b35e277e0725ba480b9e35940ffa Mon Sep 17 00:00:00 2001 From: J-N-K Date: Sun, 13 Aug 2023 18:20:02 +0200 Subject: [PATCH] Fix logging in AbstractProvider implementations (#3751) Signed-off-by: Jan N. Klug --- .../model/persistence/internal/PersistenceModelManager.java | 3 +++ .../model/thing/internal/GenericItemChannelLinkProvider.java | 3 +++ .../org/openhab/core/common/registry/AbstractProvider.java | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.model.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java b/bundles/org.openhab.core.model.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java index 9b5d2b24de6..aa7688a14e7 100644 --- a/bundles/org.openhab.core.model.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java +++ b/bundles/org.openhab.core.model.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java @@ -57,6 +57,8 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is the central part of the persistence management and delegation. It reads the persistence @@ -70,6 +72,7 @@ @NonNullByDefault public class PersistenceModelManager extends AbstractProvider implements ModelRepositoryChangeListener, PersistenceServiceConfigurationProvider { + private final Logger logger = LoggerFactory.getLogger(PersistenceModelManager.class); private final Map configurations = new ConcurrentHashMap<>(); private final ModelRepository modelRepository; diff --git a/bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/GenericItemChannelLinkProvider.java b/bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/GenericItemChannelLinkProvider.java index 45b77d3ccaf..a98595405ae 100644 --- a/bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/GenericItemChannelLinkProvider.java +++ b/bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/GenericItemChannelLinkProvider.java @@ -31,6 +31,8 @@ import org.openhab.core.thing.link.ItemChannelLink; import org.openhab.core.thing.link.ItemChannelLinkProvider; import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link GenericItemChannelLinkProvider} link items to channel by reading bindings with type "channel". @@ -43,6 +45,7 @@ public class GenericItemChannelLinkProvider extends AbstractProvider implements BindingConfigReader, ItemChannelLinkProvider { + private final Logger logger = LoggerFactory.getLogger(GenericItemChannelLinkProvider.class); /** caches binding configurations. maps itemNames to {@link BindingConfig}s */ protected Map> itemChannelLinkMap = new ConcurrentHashMap<>(); diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/common/registry/AbstractProvider.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/common/registry/AbstractProvider.java index 9d076df8927..617597a231c 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/common/registry/AbstractProvider.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/common/registry/AbstractProvider.java @@ -39,7 +39,7 @@ private enum EventType { UPDATED } - protected final Logger logger = LoggerFactory.getLogger(AbstractProvider.class); + private Logger logger = LoggerFactory.getLogger(AbstractProvider.class); protected List> listeners = new CopyOnWriteArrayList<>(); @Override