Package org.apache.felix.scr.impl.logger
Class ScrLogManager.ScrLoggerFacade
java.lang.Object
org.apache.felix.scr.impl.logger.LogManager.LoggerFacade
org.apache.felix.scr.impl.logger.ScrLogManager.ScrLoggerFacade
- All Implemented Interfaces:
BundleLogger
,ComponentLogger
,InternalLogger
,ScrLogger
- Enclosing class:
ScrLogManager
class ScrLogManager.ScrLoggerFacade
extends LogManager.LoggerFacade
implements InternalLogger, ScrLogger, BundleLogger, ComponentLogger
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.felix.scr.impl.logger.InternalLogger
InternalLogger.Level
-
Field Summary
Fields inherited from class org.apache.felix.scr.impl.logger.LogManager.LoggerFacade
logger, prefix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbundle
(org.osgi.framework.Bundle bundle) Create a bundle loggervoid
close()
Close the log managerboolean
isLogEnabled
(InternalLogger.Level level) Answer true if the current logging level is enabled for the given level.void
log
(InternalLogger.Level level, String message, Throwable ex) Logs the message to an appropriate OSGi logger.void
log
(InternalLogger.Level level, String format, Throwable ex, Object... arguments) Formats the message using theMessageFormat
class, i.e.(package private) void
log0
(InternalLogger.Level level, String message, Throwable ex) void
setComponentId
(long id) (package private) void
Methods inherited from class org.apache.felix.scr.impl.logger.LogManager.LoggerFacade
getBundle, getLogger, getName, reset
-
Constructor Details
-
ScrLoggerFacade
ScrLoggerFacade(LogManager.LogDomain logDomain, String name)
-
-
Method Details
-
setComponentId
public void setComponentId(long id) - Specified by:
setComponentId
in interfaceComponentLogger
-
isLogEnabled
Description copied from interface:InternalLogger
Answer true if the current logging level is enabled for the given level. For stdout/stderr fallback the logging level is defined by theLogConfiguration.getLogLevel()
. If there is an OSGi logger available then the logger name will define the log level viaLoggerAdmin
.- Specified by:
isLogEnabled
in interfaceInternalLogger
- Parameters:
level
- the level to check- Returns:
- true if the given log level is enabled
-
log
Description copied from interface:InternalLogger
Formats the message using theMessageFormat
class, i.e. with {} place holders for the args. It then callsInternalLogger.log(Level, String, Throwable)
.- Specified by:
log
in interfaceInternalLogger
- Parameters:
level
- only log when this level is implied by the current log levelformat
- the message to logex
- a Throwable or nullarguments
- the arguments to theMessageFormat
formatting
-
log
Description copied from interface:InternalLogger
Logs the message to an appropriate OSGi logger. If not such logger can be found then it will log to stderr for ERROR invalid input: '&' AUDIT messages and stdout for other messages- Specified by:
log
in interfaceInternalLogger
- Parameters:
level
- only log when this level is implied by the current log levelmessage
- the message to logex
- a Throwable or null
-
log0
-
setPrefix
-
component
public ComponentLogger component(org.osgi.framework.Bundle bundle, String implementationClassName, String name) - Specified by:
component
in interfaceBundleLogger
-
bundle
Description copied from interface:ScrLogger
Create a bundle logger -
close
public void close()Description copied from interface:ScrLogger
Close the log manager
-