From 205861992d4d65435c3afafac515cb3fda615585 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Tue, 29 Oct 2019 11:47:30 +0100 Subject: Add debug logging --- .../src/main/java/com/yahoo/container/core/config/BundleLoader.java | 1 + container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'container-core/src') diff --git a/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java b/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java index 18886d2e5a9..9115a51b486 100644 --- a/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java +++ b/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java @@ -174,6 +174,7 @@ public class BundleLoader { public synchronized Set use(List bundles) { Set bundlesToUninstall = retainOnly(bundles); osgi.allowDuplicateBundles(bundlesToUninstall); + log.info(() -> bundlesToUninstall.isEmpty() ? "Adding bundles to allowed duplicates: " + bundlesToUninstall : ""); install(bundles); startBundles(); diff --git a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java index 5fa0e65463a..2a308cf1ffd 100644 --- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java +++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java @@ -11,12 +11,14 @@ import org.osgi.framework.launch.Framework; import java.util.Collection; import java.util.List; +import java.util.logging.Logger; /** * @author Tony Vaagenes * @author bratseth */ public class OsgiImpl implements Osgi { + private static Logger log = Logger.getLogger(OsgiImpl.class.getName()); private final OsgiFramework jdiscOsgi; @@ -36,6 +38,7 @@ public class OsgiImpl implements Osgi { alwaysCurrentBundle = firstNonFrameworkBundle(initialBundles); if (alwaysCurrentBundle == null) throw new IllegalStateException("The initial bundles only contained the framework bundle!"); + log.info("Using " + alwaysCurrentBundle + " to lookup current bundles."); } @Override @@ -111,6 +114,7 @@ public class OsgiImpl implements Osgi { * @return the bundle match having the highest version, or null if there was no matches */ public Bundle getBundle(ComponentSpecification id) { + log.fine(() -> "Getting bundle for component " + id + ". Set of current bundles: " + getCurrentBundles()); Bundle highestMatch = null; for (Bundle bundle : getCurrentBundles()) { assert bundle.getSymbolicName() != null : "ensureHasBundleSymbolicName not called during installation"; -- cgit v1.2.3