Package org.apache.felix.scr.impl.helper
Interface Logger
-
- All Known Subinterfaces:
ComponentActivator
public interface Logger
TheLogger
interface defines a simple API to enable some logging in the XML Parser and ComponentMetadata handling classes and at the same time not be too intrusive for the unit tests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isLogEnabled(int level)
Returnstrue
if logging for the given level is enabled.void
log(int level, String pattern, Object[] arguments, ComponentMetadata metadata, Long componentId, Throwable ex)
Method to actually emit the log message.void
log(int level, String message, ComponentMetadata metadata, Long componentId, Throwable ex)
Writes a messages for the givenComponentMetadata
.
-
-
-
Method Detail
-
isLogEnabled
boolean isLogEnabled(int level)
Returnstrue
if logging for the given level is enabled.
-
log
void log(int level, String pattern, Object[] arguments, ComponentMetadata metadata, Long componentId, Throwable ex)
Method to actually emit the log message. If the LogService is available, the message will be logged through the LogService. Otherwise the message is logged to stdout (or stderr in case of LOG_ERROR level messages),- Parameters:
level
- The log level to log the message atpattern
- Thejava.text.MessageFormat
message format string for preparing the messagearguments
- The format arguments for thepattern
string.metadata
- component metadata if knowncomponentId
- component ID if knownex
- An optionalThrowable
whose stack trace is written,
-
log
void log(int level, String message, ComponentMetadata metadata, Long componentId, Throwable ex)
Writes a messages for the givenComponentMetadata
.- Parameters:
level
- The log level of the messages. This corresponds to the log levels defined by the OSGi LogService.message
- The message to printmetadata
- TheComponentMetadata
whose processing caused the message. This may benull
if the component metadata is not known or applicable.componentId
-ex
- TheThrowable
causing the message to be logged.
-
-