This is an automated email from the ASF dual-hosted git repository. sseifert pushed a commit to branch experimental/WTES-69-diagnosis in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 556339ee27b200429ef18147fc77864067384399 Author: Stefan Seifert <[email protected]> AuthorDate: Tue Dec 7 08:09:46 2021 +0100 disable all log.isDebugEnabled() statements --- .../java/org/apache/sling/testing/mock/osgi/MockBundleContext.java | 4 ++++ .../main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java index 376e492..54dc455 100644 --- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java +++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java @@ -128,9 +128,11 @@ class MockBundleContext implements BundleContext { @SuppressWarnings("unchecked") @Override public ServiceRegistration registerService(final String[] clazzes, final Object service, final Dictionary properties) { + /* if (log.isDebugEnabled()) { log.debug("Register {} ({}), bundleContext={}", service.getClass().getName(), StringUtils.join(clazzes, ","), this); } + */ MockServiceRegistration<?> registration = new MockServiceRegistration<>(this.bundle, clazzes, service, properties, this); this.registeredServices.add(registration); @@ -204,11 +206,13 @@ class MockBundleContext implements BundleContext { } void unregisterService(MockServiceRegistration<?> registration) { + /* if (log.isDebugEnabled()) { Object componentInstance = registration.service; log.debug("Unregister {} ({}), bundleContext={}", componentInstance != null ? componentInstance.getClass() : "", StringUtils.join(registration.getClasses(), ","), this); } + */ boolean wasRemoved = this.registeredServices.remove(registration); if (wasRemoved) { diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java index 1f1443e..da6578b 100644 --- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java +++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java @@ -73,9 +73,11 @@ public final class MockEventAdmin implements EventAdmin { @Override public void postEvent(final Event event) { + /* if (log.isDebugEnabled()) { log.debug("Send event: {}, bundleContext={}", event.getTopic(), this.bundleContext); } + */ try { asyncHandler.execute(new Runnable() { @Override @@ -100,9 +102,11 @@ public final class MockEventAdmin implements EventAdmin { for (EventHandlerItem item : eventHandlers.values()) { if (item.matches(event)) { try { + /* if (log.isDebugEnabled()) { log.debug("Distribute event: {} to {}, bundleContext={}", event.getTopic(), item.getEventHandler().getClass(), this.bundleContext); } + */ item.getEventHandler().handleEvent(event); } catch (Throwable ex) {
