diff options
author | Thomas Watson | 2016-03-31 16:32:19 +0000 |
---|---|---|
committer | Thomas Watson | 2017-06-16 12:38:08 +0000 |
commit | 9566e37ecdca4821070a7a45836264566c9f3c37 (patch) | |
tree | b0eb0cfd6a423b8fb79d08efe556f7c245843fa4 /bundles/org.eclipse.osgi/osgi | |
parent | 6ef43b45c7ae11c1859cf969d8e11f2dc53689cc (diff) | |
download | rt.equinox.framework-9566e37ecdca4821070a7a45836264566c9f3c37.tar.gz rt.equinox.framework-9566e37ecdca4821070a7a45836264566c9f3c37.tar.xz rt.equinox.framework-9566e37ecdca4821070a7a45836264566c9f3c37.zip |
Bug 486950 - [osgi R7] log service is being updated
Implement new getLogger method that takes a bundle
Change-Id: Ibd50163c2390c5853274cfa72662fd775c7f02ec
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.osgi/osgi')
-rw-r--r-- | bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LoggerFactory.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LoggerFactory.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LoggerFactory.java index 3d17ce95f..61d256f03 100644 --- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LoggerFactory.java +++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LoggerFactory.java @@ -17,6 +17,7 @@ package org.osgi.service.log; import org.osgi.annotation.versioning.ProviderType; +import org.osgi.framework.Bundle; /** * Logger Factory service for logging information. @@ -100,4 +101,29 @@ public interface LoggerFactory { * Logger type. */ <L extends Logger> L getLogger(Class< ? > clazz, Class<L> loggerType); + + /** + * Return the {@link Logger} of the specified type named with the specified + * name for the specified bundle. + * <p> + * This method is not normally used. The other {@code getLogger} methods + * return a {@link Logger} associated with the bundle used to obtain this + * Logger Factory service. This method is used to obtain a {@link Logger} + * for the specified bundle which may be useful to code which is logging on + * behalf of another bundle. + * + * @param <L> The Logger type. + * @param bundle The bundle associated with the Logger. + * @param name The name to use for the logger name. + * @param loggerType The type of Logger. Can be {@link Logger} or + * {@link FormatterLogger}. + * @return The {@link Logger} or {@link FormatterLogger} named with the + * specified name for the specified bundle. If the name parameter is + * equal to {@link Logger#ROOT_LOGGER_NAME}, then the root logger is + * returned. + * @throws IllegalArgumentException If the specified type is not a supported + * Logger type or the specified Bundle is not a resolved bundle. + */ + <L extends Logger> L getLogger(Bundle bundle, String name, + Class<L> loggerType); } |