Package org.apache.felix.scr.impl.logger
Class NoOpLogger
- java.lang.Object
-
- org.apache.felix.scr.impl.logger.NoOpLogger
-
- All Implemented Interfaces:
BundleLogger,ComponentLogger,InternalLogger,ScrLogger
public class NoOpLogger extends java.lang.Object implements ScrLogger, BundleLogger, ComponentLogger
This is a dummy logger which is only used when the logging is not enabled at all.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.felix.scr.impl.logger.InternalLogger
InternalLogger.Level
-
-
Constructor Summary
Constructors Constructor Description NoOpLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BundleLoggerbundle(org.osgi.framework.Bundle bundle)Create a bundle loggervoidclose()Close the log managerComponentLoggercomponent(org.osgi.framework.Bundle bundle, java.lang.String implementationClassName, java.lang.String name)booleanisLogEnabled(InternalLogger.Level level)Answer true if the current logging level is enabled for the given level.voidlog(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex)Logs the message to an appropriate OSGi logger.voidlog(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex, java.lang.Object... args)Formats the message using theMessageFormatclass, i.e.voidsetComponentId(long componentId)
-
-
-
Method Detail
-
log
public void log(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex)
Description copied from interface:InternalLoggerLogs the message to an appropriate OSGi logger. If not such logger can be found then it will log to stderr for ERROR & AUDIT messages and stdout for other messages- Specified by:
login interfaceInternalLogger- Parameters:
level- only log when this level is implied by the current log levelmessage- the message to logex- a Throwable or null
-
log
public void log(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex, java.lang.Object... args)
Description copied from interface:InternalLoggerFormats the message using theMessageFormatclass, i.e. with {} place holders for the args. It then callsInternalLogger.log(Level, String, Throwable).- Specified by:
login interfaceInternalLogger- Parameters:
level- only log when this level is implied by the current log levelmessage- the message to logex- a Throwable or nullargs- the arguments to theMessageFormatformatting
-
isLogEnabled
public boolean isLogEnabled(InternalLogger.Level level)
Description copied from interface:InternalLoggerAnswer 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:
isLogEnabledin interfaceInternalLogger- Parameters:
level- the level to check- Returns:
- true if the given log level is enabled
-
setComponentId
public void setComponentId(long componentId)
- Specified by:
setComponentIdin interfaceComponentLogger
-
component
public ComponentLogger component(org.osgi.framework.Bundle bundle, java.lang.String implementationClassName, java.lang.String name)
- Specified by:
componentin interfaceBundleLogger
-
bundle
public BundleLogger bundle(org.osgi.framework.Bundle bundle)
Description copied from interface:ScrLoggerCreate a bundle logger
-
-