Package org.apache.felix.scr.impl.logger
Interface InternalLogger
- All Known Subinterfaces:
BundleLogger
,ComponentLogger
,ScrLogger
- All Known Implementing Classes:
NoOpLogger
,ScrLogManager.ScrLoggerFacade
public interface InternalLogger
Base 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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 message, Throwable ex, Object... args) Formats the message using theMessageFormat
class, i.e.
-
Method Details
-
log
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- Parameters:
level
- only log when this level is implied by the current log levelmessage
- the message to logex
- a Throwable or null
-
log
Formats the message using theMessageFormat
class, 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 theMessageFormat
formatting
-
isLogEnabled
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
-