|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.debug.Debug
Debug is a singleton with static methods to log information. Debug is proxy to the actual logging class. You use Debug with any logging system by implementing a LoggerAdapter for the target system. You can then assign that loggin system to this Debug by using the setLoggerAdapter method. By default Debug will create its own SimpleLogger which outputs to the err device.
SimpleLogger
Field Summary | |
static int |
DEBUG
DEBUG level is highest logging level |
static int |
ERROR
ERROR level is fourth highest logging level |
static int |
FATAL
FATAL level is lowest logging level |
static int |
INFO
INFO level is second highest logging level |
static java.lang.String[] |
LEVEL_NAMES
String array of logging level names |
static int |
WARN
WARN level is third highest logging level |
Method Summary | |
static void |
debug(java.lang.Object message)
Writes the given DEBUG message to the log if the DEBUG logging level is enabled |
static void |
debug(java.lang.Object message,
java.lang.Throwable t)
Writes the given DEBUG message and stack trace to the log if the DEBUG logging level is enabled |
static void |
error(java.lang.Object message)
Writes the given ERROR message to the log if the ERROR logging level is enabled |
static void |
error(java.lang.Object message,
java.lang.Throwable t)
Writes the given ERROR message and stack trace to the log if the ERROR logging level is enabled |
static void |
fatal(java.lang.Object message)
Writes the given FATAL message to the log if the FATAL logging level is enabled |
static void |
fatal(java.lang.Object message,
java.lang.Throwable t)
Writes the given FATAL message and stack trace to the log if the FATAL logging level is enabled |
static Debug |
getInstance()
Returns the singleton Debug instance. |
static LoggerAdapter |
getLoggerAdapter()
Gets the LoggerAdapter used by the singleton Debug. |
static void |
info(java.lang.Object message)
Writes the given INFO message to the log if the INFO logging level is enabled |
static void |
info(java.lang.Object message,
java.lang.Throwable t)
Writes the given INFO message and stack trace to the log if the INFO logging level is enabled |
static boolean |
isDebugEnabled()
Indicates whether or not the DEBUG level is enabled for logging. |
boolean |
isEnabledFor(int level)
Indicates whether or not the given level is enabled for logging. |
static boolean |
isInfoEnabled()
Indicates whether or not the INFO level is enabled for logging. |
static void |
log(int level,
java.lang.String message)
Writes the given level message to the log if the given logging level is enabled |
static void |
log(int level,
java.lang.String message,
java.lang.Throwable t)
Writes the given level message and stack trace to the log if the given logging level is enabled |
static void |
setLoggerAdapter(LoggerAdapter loggerAdapter)
Sets the LoggerAdapter used by the singleton Debug. |
static void |
warn(java.lang.Object message)
Writes the given WARN message to the log if the WARN logging level is enabled |
static void |
warn(java.lang.Object message,
java.lang.Throwable t)
Writes the given WARN message and stack trace to the log if the WARN logging level is enabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEBUG
public static final int INFO
public static final int WARN
public static final int ERROR
public static final int FATAL
public static final java.lang.String[] LEVEL_NAMES
Method Detail |
public static Debug getInstance()
public static void setLoggerAdapter(LoggerAdapter loggerAdapter)
loggerAdapter
- to by used by the singleton Debug.public static LoggerAdapter getLoggerAdapter()
public static void debug(java.lang.Object message)
message
- is an object which contains the message to logpublic static void debug(java.lang.Object message, java.lang.Throwable t)
message
- is an object which contains the message to logt
- throwable to be rendered using printStackTracepublic static void info(java.lang.Object message)
message
- is an object which contains the message to logpublic static void info(java.lang.Object message, java.lang.Throwable t)
message
- is an object which contains the message to logt
- throwable to be rendered using printStackTracepublic static void warn(java.lang.Object message)
message
- is an object which contains the message to logpublic static void warn(java.lang.Object message, java.lang.Throwable t)
message
- is an object which contains the message to logt
- throwable to be rendered using printStackTracepublic static void error(java.lang.Object message)
message
- is an object which contains the message to logpublic static void error(java.lang.Object message, java.lang.Throwable t)
message
- is an object which contains the message to logt
- throwable to be rendered using printStackTracepublic static void fatal(java.lang.Object message)
message
- is an object which contains the message to logpublic static void fatal(java.lang.Object message, java.lang.Throwable t)
message
- is an object which contains the message to logt
- throwable to be rendered using printStackTracepublic static boolean isDebugEnabled()
public static boolean isInfoEnabled()
public boolean isEnabledFor(int level)
level
- to check if enabled
public static void log(int level, java.lang.String message)
level
- of log messagemessage
- is an object which contains the message to logpublic static void log(int level, java.lang.String message, java.lang.Throwable t)
level
- of log messagemessage
- is an object which contains the message to logt
- throwable to be rendered using printStackTrace
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |