Package org.apache.felix.scr.impl.logger
Class BundleLogger
java.lang.Object
org.apache.felix.scr.impl.logger.AbstractLogger
org.apache.felix.scr.impl.logger.LogServiceEnabledLogger
org.apache.felix.scr.impl.logger.BundleLogger
The
BundleLogger
defines a simple API to enable some logging on behalf of
an extended bundle. This avoids that all clients doing logging on behalf of
a component bundle need to pass in things like BundleContext
.-
Field Summary
FieldsFields inherited from class org.apache.felix.scr.impl.logger.LogServiceEnabledLogger
logServiceTracker, trackingCount
-
Constructor Summary
ConstructorsConstructorDescriptionBundleLogger
(org.osgi.framework.BundleContext bundleContext, ScrLogger parent) -
Method Summary
Modifier and TypeMethodDescription(package private) InternalLogger
(package private) InternalLogger
(package private) int
boolean
Method to actually emit the log message.boolean
Method to actually emit the log message.Methods inherited from class org.apache.felix.scr.impl.logger.LogServiceEnabledLogger
close, getLogger
Methods inherited from class org.apache.felix.scr.impl.logger.AbstractLogger
getBundleIdentifier, getConfiguration, getPrefix, isLogEnabled, setPrefix
-
Field Details
-
parent
-
-
Constructor Details
-
BundleLogger
-
-
Method Details
-
getDefaultLogger
InternalLogger getDefaultLogger()- Specified by:
getDefaultLogger
in classLogServiceEnabledLogger
-
getTrackingCount
int getTrackingCount() -
getLogger
-
log
Description copied from class:AbstractLogger
Method to actually emit the log message. If the LogService is available, the message will be logged through the LogService. Otherwise the message is logged to stdout (or stderr in case of LOG_ERROR level messages),- Overrides:
log
in classAbstractLogger
- Parameters:
level
- The log level to log the message atpattern
- Thejava.text.MessageFormat
message format string for preparing the messageex
- An optionalThrowable
whose stack trace is written,arguments
- The format arguments for thepattern
string.
-
log
Description copied from class:AbstractLogger
Method to actually emit the log message. If the LogService is available, the message will be logged through the LogService. Otherwise the message is logged to stdout (or stderr in case of LOG_ERROR level messages),- Overrides:
log
in classAbstractLogger
- Parameters:
level
- The log level of the messages. This corresponds to the log levels defined by the OSGi LogService.message
- The message to printex
- TheThrowable
causing the message to be logged.
-