public class LogHandler extends Object
ILogListener
interface. Listeners are registered via the WSClient.addLogListener()
convenience methodModifier and Type | Field and Description |
---|---|
protected ArrayList<ILogListener> |
m_listenerList |
protected static LogHandler |
m_logHandler |
Constructor and Description |
---|
LogHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ILogListener listener)
Add a
ILogListener implementation to the list of listeners notified when a logging
event is fire. |
void |
fireLogEvent(String category,
String module,
String logMessage)
Fire a logging event, notifying all each of our registered log listeners
|
void |
fireLogEvent(String category,
String module,
String logMessage,
Throwable t)
Fire an exception logging event, notifying all each of our registered log listeners
|
static LogHandler |
getInstance()
Get the singleton instance of the LogHandler
|
static void |
logDebug(String module,
String logMessage)
Convenience method for generating a debug logging message error for the given module
|
static void |
logError(String module,
String logMessage)
Convenience method for logging an error for the given module
|
static void |
logException(String module,
String logMessage,
Throwable throwable)
Convenience method for generating an error logging message for a given exception
|
void |
removeListener(ILogListener listener)
Remove a specific
ILogListener implementation from the list of listeners |
static void |
shutdown() |
protected static LogHandler m_logHandler
protected ArrayList<ILogListener> m_listenerList
public static LogHandler getInstance()
LogHandler
public static void shutdown()
public void fireLogEvent(String category, String module, String logMessage)
category
- the log category as stringmodule
- the logging module as stringlogMessage
- the message to add to the logpublic void fireLogEvent(String category, String module, String logMessage, Throwable t)
category
- the log category as stringcategory
- the log category as stringmodule
- the logging module as stringlogMessage
- the message to add to the logt
- the thrown exception as Throwablepublic void addListener(ILogListener listener)
ILogListener
implementation to the list of listeners notified when a logging
event is fire.listener
- the ILogListener
implementation to be notified of logging eventspublic void removeListener(ILogListener listener)
ILogListener
implementation from the list of listenerslistener
- the ILogListener
implementation to be notified of logging eventspublic static void logError(String module, String logMessage)
module
- the module that generated the errorlogMessage
- the error message as stringpublic static void logDebug(String module, String logMessage)
module
- the module that generated the messagelogMessage
- the debug message as stringpublic static void logException(String module, String logMessage, Throwable throwable)
module
- the module that generated the errorlogMessage
- the debug message as stringthrowable
- the exception to be logged