Package org.apache.felix.scr.impl.logger
Class ScrLogManager
- java.lang.Object
-
- org.osgi.util.tracker.ServiceTracker<java.lang.Object,java.lang.Object>
-
- org.apache.felix.scr.impl.logger.LogManager
-
- org.apache.felix.scr.impl.logger.ScrLogManager
-
- All Implemented Interfaces:
java.util.EventListener,org.osgi.framework.BundleListener,org.osgi.util.tracker.ServiceTrackerCustomizer<java.lang.Object,java.lang.Object>
- Direct Known Subclasses:
ExtLogManager
public class ScrLogManager extends LogManager
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 theLogManager. This class implements the existing behavior and theExtLogManagerimplements the extension behavior. Thescr()method makes this distinction based on the configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classScrLogManager.ScrLoggerFacade-
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.logger.LogManager
LogManager.Lock, LogManager.LogDomain, LogManager.LoggerFacade
-
-
Field Summary
Fields Modifier and Type Field Description private org.osgi.framework.Bundlebundleprivate LogConfigurationconfig-
Fields inherited from class org.apache.felix.scr.impl.logger.LogManager
closed, lock, scrContext
-
-
Constructor Summary
Constructors Constructor Description ScrLogManager(org.osgi.framework.BundleContext context, LogConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BundleLoggerbundle(org.osgi.framework.Bundle bundle)This logger is used for the logging on a per bundle basis.ComponentLoggercomponent(org.osgi.framework.Bundle bundle, java.lang.String implementationClass, java.lang.String name)This logger is used for the logging on a per bundle basis.(package private) java.lang.StringcomponentPrefix(ScrLogManager.ScrLoggerFacade slf, long id)(package private) LogManager.LoggerFacadecreateLoggerFacade(LogManager.LogDomain logDomain, java.lang.String name)(package private) java.lang.Stringformat(java.lang.String pattern, java.lang.Object... arguments)(package private) java.lang.StringgetBundleIdentifier(org.osgi.framework.Bundle bundle)(package private) InternalLogger.LevelgetLogLevel()ScrLoggerscr()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
-
-
-
-
Field Detail
-
bundle
private final org.osgi.framework.Bundle bundle
-
config
private final LogConfiguration config
-
-
Constructor Detail
-
ScrLogManager
ScrLogManager(org.osgi.framework.BundleContext context, LogConfiguration config)
-
-
Method Detail
-
scr
public ScrLogger scr()
This logger is used for the main code of SCR. This will use the SCR bundle & theLogger.ROOT_LOGGER_NAME- Returns:
- scr logger.
-
bundle
public BundleLogger bundle(org.osgi.framework.Bundle bundle)
This logger is used for the logging on a per bundle basis. This will use the target bundle & 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, java.lang.String implementationClass, java.lang.String name)
This logger is used for the logging on a per bundle basis. This will use the target bundle & the implementation class as logger name.- Parameters:
bundle- the target bundle- Returns:
- a logger suitable to log bundle entries
-
createLoggerFacade
LogManager.LoggerFacade createLoggerFacade(LogManager.LogDomain logDomain, java.lang.String name)
- Overrides:
createLoggerFacadein classLogManager
-
getLogLevel
InternalLogger.Level getLogLevel()
-
getBundleIdentifier
java.lang.String getBundleIdentifier(org.osgi.framework.Bundle bundle)
-
componentPrefix
java.lang.String componentPrefix(ScrLogManager.ScrLoggerFacade slf, long id)
-
format
java.lang.String format(java.lang.String pattern, java.lang.Object... arguments)
-
-