Package org.apache.felix.scr.impl.logger
Class ScrLogManager
java.lang.Object
org.osgi.util.tracker.ServiceTracker<Object,Object>
org.apache.felix.scr.impl.logger.LogManager
org.apache.felix.scr.impl.logger.ScrLogManager
- All Implemented Interfaces:
EventListener
,org.osgi.framework.BundleListener
,org.osgi.util.tracker.ServiceTrackerCustomizer<Object,
Object>
- Direct Known Subclasses:
ExtLogManager
Implements a SCR based log manager. This class was needed to not change the
whole codebase. It looks very similar to the old logging but leverages the
LogManager
. This class implements the existing behavior and the
ExtLogManager
implements the extension behavior. The scr()
method makes this distinction based on the configuration.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.felix.scr.impl.logger.LogManager
LogManager.Lock, LogManager.LogDomain, LogManager.LoggerFacade
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.osgi.framework.Bundle
private final LogConfiguration
Fields inherited from class org.apache.felix.scr.impl.logger.LogManager
closed, lock, scrContext
Fields inherited from class org.osgi.util.tracker.ServiceTracker
context, filter
-
Constructor Summary
ConstructorsConstructorDescriptionScrLogManager
(org.osgi.framework.BundleContext context, LogConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionbundle
(org.osgi.framework.Bundle bundle) This logger is used for the logging on a per bundle basis.This logger is used for the logging on a per bundle basis.(package private) String
componentPrefix
(ScrLogManager.ScrLoggerFacade slf, long id) (package private) LogManager.LoggerFacade
createLoggerFacade
(LogManager.LogDomain logDomain, String name) (package private) String
(package private) String
getBundleIdentifier
(org.osgi.framework.Bundle bundle) (package private) InternalLogger.Level
scr()
This logger is used for the main code of SCR.Methods inherited from class org.apache.felix.scr.impl.logger.LogManager
addingService, bundleChanged, close, getLogger, init, removedService
Methods inherited from class org.osgi.util.tracker.ServiceTracker
getService, getService, getServiceReference, getServiceReferences, getServices, getServices, getTracked, getTrackingCount, isEmpty, modifiedService, open, open, remove, size, waitForService
-
Field Details
-
bundle
private final org.osgi.framework.Bundle bundle -
config
-
-
Constructor Details
-
ScrLogManager
ScrLogManager(org.osgi.framework.BundleContext context, LogConfiguration config)
-
-
Method Details
-
scr
This logger is used for the main code of SCR. This will use the SCR bundle invalid input: '&' theLogger.ROOT_LOGGER_NAME
- Returns:
- scr logger.
-
bundle
This logger is used for the logging on a per bundle basis. This will use the target bundle invalid input: '&' theLogger.ROOT_LOGGER_NAME
- Parameters:
bundle
- the target bundle- Returns:
- a logger suitable to log bundle entries
-
component
public ComponentLogger component(org.osgi.framework.Bundle bundle, String implementationClass, String name) This logger is used for the logging on a per bundle basis. This will use the target bundle invalid input: '&' the implementation class as logger name.- Parameters:
bundle
- the target bundle- Returns:
- a logger suitable to log bundle entries
-
createLoggerFacade
- Overrides:
createLoggerFacade
in classLogManager
-
getLogLevel
InternalLogger.Level getLogLevel() -
getBundleIdentifier
-
componentPrefix
-
format
-