public class GlueLogListener extends Object implements ILogListener
electric.util.log.WriterLogger
to write to the application provided
Writer
.Modifier and Type | Field and Description |
---|---|
static String |
DEBUG |
ERROR, INFO
Constructor and Description |
---|
GlueLogListener() |
Modifier and Type | Method and Description |
---|---|
static ILogger |
getDefaultLogger()
Get the default
electric.util.log.ILogger object that GLUE provides. |
static ILogger |
getLogger(String name)
Get the
electric.util.log.ILogger object registered with the GLUE logging
subsystem with the specified name. |
static boolean |
isLogging(String category)
Check if any registered loggers is logging the specified
category
|
static void |
log(String category,
Object message)
Check if any registered loggers is logging the specified
category and if so, log the message specified.
|
static void |
logDebug(String message)
Log the verbose debug message
|
static void |
logDebug(String module,
String message)
Log the verbose debug message from the specified module.
|
static void |
logError(String message)
Log the error message
|
static void |
logError(String module,
String message)
Log the error message from the specified module.
|
static void |
logException(String message,
Throwable throwable)
Log the Throwable from the specified module.
|
static void |
logException(Throwable throwable)
Log the Throwable from the specified module.
|
static void |
logMapping(String message)
Log the verbose mapping message
|
static void |
logMapping(String module,
String message)
Log the verbose mapping message from the specified module.
|
static void |
logNormal(String message)
Log the normal message
|
static void |
logNormal(String module,
String message)
Log the normal message from the specified module.
|
static void |
logWarning(String message)
Log the warning message
|
static void |
logWarning(String module,
String message)
Log the warning message from the specified module.
|
void |
onLogEvent(String logMessage,
String module,
String category)
Event handler method implementation of the ILogListener interface
Category can be one of
ILogListener.ERROR , ILogListener.DEBUG or ILogListener.INFO |
void |
onLogEvent(String category,
String module,
String logMessage,
Throwable t)
Event handler method implementation of the ILogListener interface
Category can be one of
ILogListener.ERROR , ILogListener.DEBUG or ILogListener.INFO |
static void |
registerLogger(String name,
Writer writer)
Registers a
electric.util.log.WriterLogger object with the GLUE logging
subsystem. |
static void |
startLogging(String category)
Start logging the specified category
|
static void |
stopLogging(String category)
Stop logging the specified category
|
public static final String DEBUG
public static void registerLogger(String name, Writer writer) throws Exception
electric.util.log.WriterLogger
object with the GLUE logging
subsystem. This is necessary only when an application needs to
have a electric.util.log.ILogger
that writes to a specific Writer
.
GLUE provides a default electric.util.log.ILogger
that writes to the console.public static ILogger getLogger(String name)
electric.util.log.ILogger
object registered with the GLUE logging
subsystem with the specified name.name
- the name of the electric.util.log.ILogger
objectelectric.util.log.ILogger
objectpublic static ILogger getDefaultLogger()
electric.util.log.ILogger
object that GLUE provides.electric.util.log.ILogger
objectpublic static boolean isLogging(String category)
category
- the logging categorypublic static void startLogging(String category)
category
- the logging categorypublic static void stopLogging(String category)
category
- the logging categorypublic static void log(String category, Object message)
category
- the logging categorymessage
- the log messagepublic static void logError(String module, String message)
module
- name of the module logging the messagemessage
- the log messagepublic static void logError(String message)
message
- the log messagepublic static void logException(String message, Throwable throwable)
message
- the log messagethrowable
- the Throwable
objectpublic static void logException(Throwable throwable)
throwable
- the Throwable
objectpublic static void logWarning(String module, String message)
module
- name of the module logging the messagemessage
- the log messagepublic static void logWarning(String message)
message
- the log messagepublic static void logNormal(String module, String message)
module
- name of the module logging the messagemessage
- the log messagepublic static void logNormal(String message)
message
- the log messagepublic static void logDebug(String module, String message)
module
- name of the module logging the messagemessage
- the log messagepublic static void logDebug(String message)
message
- the log messagepublic static void logMapping(String module, String message)
module
- name of the module logging the messagemessage
- the log messagepublic static void logMapping(String message)
message
- the log messagepublic void onLogEvent(String logMessage, String module, String category)
ILogListener
ILogListener.ERROR
, ILogListener.DEBUG
or ILogListener.INFO
onLogEvent
in interface ILogListener
logMessage
- the serveritymodule
- the originating class / modulecategory
- the message detailspublic void onLogEvent(String category, String module, String logMessage, Throwable t)
ILogListener
ILogListener.ERROR
, ILogListener.DEBUG
or ILogListener.INFO
onLogEvent
in interface ILogListener
category
- the serveritymodule
- the originating class / modulelogMessage
- the message detailst
- the exception