This is an automated email from the ASF dual-hosted git repository.
rotty3000 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/aries.git
The following commit(s) were added to refs/heads/trunk by this push:
new 54ea07a ARIES-2009 Lower or remap the level of some log events to
reduce noise
54ea07a is described below
commit 54ea07ad1f21312b6c4d914cf1454b33289695d2
Author: Raymond Augé <[email protected]>
AuthorDate: Sun Oct 4 11:28:35 2020 -0400
ARIES-2009 Lower or remap the level of some log events to reduce noise
Signed-off-by: Raymond Augé <[email protected]>
---
.../org/apache/aries/spifly/BaseActivator.java | 6 ++++--
.../spifly/ProviderBundleTrackerCustomizer.java | 22 +++++++++++-----------
.../main/java/org/apache/aries/spifly/Util.java | 14 +++++++-------
3 files changed, 22 insertions(+), 20 deletions(-)
diff --git
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
index 071f6b9..3b65715 100644
---
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
+++
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/BaseActivator.java
@@ -91,7 +91,7 @@ public abstract class BaseActivator implements
BundleActivator {
).map(Parameters::new);
}
catch (Throwable t) {
- logger.log(Level.SEVERE, t.getMessage(), t);
+ log(Level.FINE, t.getMessage(), t);
}
providerBundleTracker = new BundleTracker(context,
@@ -239,7 +239,9 @@ public abstract class BaseActivator implements
BundleActivator {
}
public void log(Level level, String message, Throwable th) {
- logger.log(level, message, th);
+ if (logger.isLoggable(level)) {
+ logger.log(level, message, th);
+ }
}
public Set<WeavingData> getWeavingData(Bundle b) {
diff --git
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
index e9bf68a..178ec99 100644
---
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
+++
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/ProviderBundleTrackerCustomizer.java
@@ -92,7 +92,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
try {
providedServices =
readServiceLoaderMediatorCapabilityMetadata(bundle, customAttributes);
} catch (InvalidSyntaxException e) {
- log(Level.SEVERE, "Unable to read capabilities from bundle " +
bundle, e);
+ log(Level.FINE, "Unable to read capabilities from bundle " +
bundle, e);
}
}
@@ -121,7 +121,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
+ bundle.getSymbolicName());
return null;
} else {
- log(Level.INFO, "Examining bundle for SPI provider: "
+ log(Level.FINE, "Examining bundle for SPI provider: "
+ bundle.getSymbolicName());
}
@@ -141,7 +141,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
try {
final Class<?> cls = bundle.loadClass(details.instanceType);
- log(Level.INFO, "Loaded SPI provider: " + cls);
+ log(Level.FINE, "Loaded SPI provider: " + cls);
if (details.properties != null) {
ServiceRegistration reg = null;
@@ -157,7 +157,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
reg = bundle.getBundleContext().registerService(
details.serviceType, instance,
details.properties);
} else {
- log(Level.INFO, "Bundle " + bundle + " does not
have the permission to register services of type: " + details.serviceType);
+ log(Level.FINE, "Bundle " + bundle + " does not
have the permission to register services of type: " + details.serviceType);
}
} else {
reg = bundle.getBundleContext().registerService(
@@ -166,14 +166,14 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
if (reg != null) {
registrations.add(reg);
- log(Level.INFO, "Registered service: " + reg);
+ log(Level.FINE, "Registered service: " + reg);
}
}
activator.registerProviderBundle(details.serviceType, bundle,
details.properties);
log(Level.INFO, "Registered provider " + details.instanceType
+ " of service " + details.serviceType + " in bundle " +
bundle.getSymbolicName());
} catch (Exception e) {
- log(Level.WARNING,
+ log(Level.FINE,
"Could not load provider " + details.instanceType + " of
service " + details.serviceType, e);
}
}
@@ -185,7 +185,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
List<ServiceDetails> serviceDetails = new ArrayList<>();
for (URL serviceFileURL : serviceFileURLs) {
- log(Level.INFO, "Found SPI resource: " + serviceFileURL);
+ log(Level.FINE, "Found SPI resource: " + serviceFileURL);
try {
BufferedReader reader = new BufferedReader(
@@ -233,12 +233,12 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
serviceDetails.add(new
ServiceDetails(registrationClassName, className, properties));
} catch (Exception e) {
- log(Level.WARNING,
+ log(Level.FINE,
"Could not load SPI implementation referred
from " + serviceFileURL, e);
}
}
} catch (IOException e) {
- log(Level.WARNING, "Could not read SPI metadata from " +
serviceFileURL, e);
+ log(Level.FINE, "Could not read SPI metadata from " +
serviceFileURL, e);
}
}
@@ -434,7 +434,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
}
}
} catch (IOException e) {
- log(Level.SEVERE, "Problem opening embedded jar file: " + url, e);
+ log(Level.FINE, "Problem opening embedded jar file: " + url, e);
}
return urls;
}
@@ -455,7 +455,7 @@ public class ProviderBundleTrackerCustomizer implements
BundleTrackerCustomizer
for (ServiceRegistration reg : (List<ServiceRegistration>)
registrations) {
try {
reg.unregister();
- log(Level.INFO, "Unregistered: " + reg);
+ log(Level.FINE, "Unregistered: " + reg);
} catch (IllegalStateException ise) {
// Ignore the exception but do not remove the try/catch.
// There are some bundle context races on cleanup which
diff --git
a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/Util.java
b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/Util.java
index 603dd60..1bed947 100644
--- a/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/Util.java
+++ b/spi-fly/spi-fly-core/src/main/java/org/apache/aries/spifly/Util.java
@@ -87,7 +87,7 @@ public class Util {
);
if (!(bundleLoader instanceof BundleReference)) {
- BaseActivator.activator.log(Level.WARNING, "Classloader of
consuming bundle doesn't implement BundleReference: " + bundleLoader);
+ BaseActivator.activator.log(Level.FINE, "Classloader of consuming
bundle doesn't implement BundleReference: " + bundleLoader);
return ServiceLoader.load(service);
}
@@ -140,7 +140,7 @@ public class Util {
);
if (!(bundleLoader instanceof BundleReference)) {
- BaseActivator.activator.log(Level.WARNING, "Classloader of
consuming bundle doesn't implement BundleReference: " + bundleLoader);
+ BaseActivator.activator.log(Level.FINE, "Classloader of consuming
bundle doesn't implement BundleReference: " + bundleLoader);
return ServiceLoader.load(service, specifiedClassLoader);
}
@@ -165,7 +165,7 @@ public class Util {
final ClassLoader cl = findContextClassloader(br.getBundle(), cls,
method, clsArg);
if (cl != null) {
- BaseActivator.activator.log(Level.INFO, "Temporarily setting
Thread Context Classloader to: " + cl);
+ BaseActivator.activator.log(Level.FINE, "Temporarily setting
Thread Context Classloader to: " + cl);
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
@@ -174,7 +174,7 @@ public class Util {
}
});
} else {
- BaseActivator.activator.log(Level.WARNING, "No classloader found
for " + cls + ":" + method + "(" + clsArg + ")");
+ BaseActivator.activator.log(Level.FINE, "No classloader found for
" + cls + ":" + method + "(" + clsArg + ")");
}
}
@@ -194,7 +194,7 @@ public class Util {
sm.checkPermission(new ServicePermission(requestedClass,
ServicePermission.GET));
} catch (AccessControlException ace) {
// access denied
- activator.log(Level.INFO, "No permission to obtain service
of type: " + requestedClass);
+ activator.log(Level.FINE, "No permission to obtain service
of type: " + requestedClass);
return null;
}
}
@@ -320,7 +320,7 @@ public class Util {
}
if (!(bundleLoader instanceof BundleReference)) {
- BaseActivator.activator.log(Level.WARNING, "Classloader of
consuming bundle doesn't implement BundleReference: " + bundleLoader);
+ BaseActivator.activator.log(Level.FINE, "Classloader of consuming
bundle doesn't implement BundleReference: " + bundleLoader);
return null;
}
@@ -347,7 +347,7 @@ public class Util {
jis.close();
}
} catch (IOException e) {
- BaseActivator.activator.log(Level.SEVERE, "Problem loading class
from embedded jar file: " + url +
+ BaseActivator.activator.log(Level.FINE, "Problem loading class
from embedded jar file: " + url +
" in bundle " + b.getSymbolicName(), e);
}
return null;