Remove IdlLightConfig.log() 49/101749/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Jul 2022 00:22:11 +0000 (02:22 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Jul 2022 00:22:46 +0000 (02:22 +0200)
Implement a proper toString() rather than a dedicated log() method.

Change-Id: If102dd9e526e4bccd6c3617b97603932d5eb8750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java

index ade3e70fbe66e942766f745ee9ce3f776617db17..1c362821c4485fcf4fc811ac8f87242f37192602 100644 (file)
@@ -5,32 +5,25 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.aaa.datastore.h2;
 
+import com.google.common.base.MoreObjects;
 import java.io.File;
 import org.immutables.value.Value;
 import org.immutables.value.Value.Default;
 import org.immutables.value.Value.Immutable;
 import org.immutables.value.Value.Style.ImplementationVisibility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * Responsible for providing configuration properties for the IDMLight/H2 data
- * store implementation.
+ * Responsible for providing configuration properties for the IDMLight/H2 data store implementation.
  *
  * @author peter.mellquist@hp.com - Initial contribution
- * @author Michael Vorburger.ch - Made it configurable, as Immutable with
- *         Builder
+ * @author Michael Vorburger.ch - Made it configurable, as Immutable with a Builder
  */
 @Immutable
 @Value.Style(strictBuilder = true, builder = "new",
     typeImmutable = "*Impl", visibility = ImplementationVisibility.PRIVATE)
 public abstract class IdmLightConfig {
-
-    private static final Logger LOG = LoggerFactory.getLogger(IdmLightConfig.class);
-
     /**
      * The filename for the H2 database file.
      *
@@ -106,9 +99,12 @@ public abstract class IdmLightConfig {
         return getDbConnectionStringPrefix() + getDbDirectory() + File.separatorChar + getDbName();
     }
 
-    public void log() {
-        LOG.info("DB Path                 : {}", getDbConnectionString());
-        LOG.info("DB Driver               : {}", getDbDriver());
-        LOG.info("DB Valid Time Out       : {}", getDbValidTimeOut());
+    @Override
+    public final String toString() {
+        return MoreObjects.toStringHelper(this)
+            .add("path", getDbConnectionString())
+            .add("driver", getDbDriver())
+            .add("validity timeout", getDbValidTimeOut())
+            .toString();
     }
 }