public class LoggingHandlerImpl extends ComponentBase implements LoggingHandler, EventListener
LoggingHandler
implementation that logs messages to System.out
.LoggingHandler.Levels
Constructor and Description |
---|
LoggingHandlerImpl(org.osgi.framework.BundleContext context) |
LoggingHandlerImpl(org.osgi.framework.BundleContext context,
LoggingHandler.Levels defaultLevel) |
Modifier and Type | Method and Description |
---|---|
void |
handle(java.lang.String topic,
java.util.Map<java.lang.String,java.lang.String> payload)
Event callback.
|
void |
logDebug(java.lang.String component,
java.lang.String message,
java.lang.Throwable exception,
java.lang.Object... args)
Log an debug message.
|
void |
logError(java.lang.String component,
java.lang.String message,
java.lang.Throwable exception,
java.lang.Object... args)
Log an error message.
|
void |
logInfo(java.lang.String component,
java.lang.String message,
java.lang.Throwable exception,
java.lang.Object... args)
Log an info message.
|
void |
logWarning(java.lang.String component,
java.lang.String message,
java.lang.Throwable exception,
java.lang.Object... args)
Log an warning message.
|
protected void |
onInit() |
protected void |
onStop() |
getAgentContext, getAgentUpdateHandler, getConfigurationHandler, getConnectionHandler, getDeploymentHandler, getDiscoveryHandler, getDownloadHandler, getEventsHandler, getExecutorService, getFeedbackHandler, getIdentificationHandler, getLoggingHandler, getWorkDir, init, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, onStart, start, stop
public LoggingHandlerImpl(org.osgi.framework.BundleContext context)
public LoggingHandlerImpl(org.osgi.framework.BundleContext context, LoggingHandler.Levels defaultLevel)
public void handle(java.lang.String topic, java.util.Map<java.lang.String,java.lang.String> payload)
EventListener
handle
in interface EventListener
topic
- The topic stringpayload
- An unmodifiable mappublic void logDebug(java.lang.String component, java.lang.String message, java.lang.Throwable exception, java.lang.Object... args)
LoggingHandler
args
are provided the message will be processed as a format using the
standard Formatter
.logDebug
in interface LoggingHandler
component
- The component identifier, not null
message
- The log message or format, not null
args
- The optional formatter argumentspublic void logInfo(java.lang.String component, java.lang.String message, java.lang.Throwable exception, java.lang.Object... args)
LoggingHandler
args
are provided the message will be processed as a format using the
standard Formatter
.logInfo
in interface LoggingHandler
component
- The component identifier, not null
message
- The log message or format, not null
args
- The optional formatter argumentspublic void logWarning(java.lang.String component, java.lang.String message, java.lang.Throwable exception, java.lang.Object... args)
LoggingHandler
args
are provided the message will be processed as a format using the
standard Formatter
.logWarning
in interface LoggingHandler
component
- The component identifier, not null
message
- The log message or format, not null
args
- The optional formatter argumentspublic void logError(java.lang.String component, java.lang.String message, java.lang.Throwable exception, java.lang.Object... args)
LoggingHandler
args
are provided the message will be processed as a format using the
standard Formatter
.logError
in interface LoggingHandler
component
- The component identifier, not null
message
- The log message or format, not null
args
- The optional formatter argumentsprotected void onInit() throws java.lang.Exception
onInit
in class ComponentBase
java.lang.Exception
protected void onStop() throws java.lang.Exception
onStop
in class ComponentBase
java.lang.Exception