Package org.apache.felix.scr.impl.logger
Interface InternalLogger
-
- All Known Subinterfaces:
BundleLogger,ComponentLogger,ScrLogger
- All Known Implementing Classes:
NoOpLogger,ScrLogManager.ScrLoggerFacade
public interface InternalLoggerBase interface for the different SCR Loggers. Since this is not used outside this package, it could be private. However, then Level should be standalone, which would change most files. So minimize the code change, it is kept public.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classInternalLogger.LevelThe level to log.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
log
void log(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex)
Logs 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- Parameters:
level- only log when this level is implied by the current log levelmessage- the message to logex- a Throwable or null
-
log
void log(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex, java.lang.Object... args)
Formats the message using theMessageFormatclass, i.e. with {} place holders for the args. It then callslog(Level, String, Throwable).- 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
boolean isLogEnabled(InternalLogger.Level level)
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.- Parameters:
level- the level to check- Returns:
- true if the given log level is enabled
-
-