|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hyphenType.debug.HTLogger
public class HTLogger
A logger that only outputs things to a PrintStream
if the
HYPHEN_TYPE_DEBUG_MODE
environment variable is set to true (ignoring case).
This class also allows for the user to replace the PrintStream
. The default
PrintStream
is System.out
.
Field Summary | |
---|---|
static String |
HYPHEN_TYPE_DEBUG_MODE
System environment key to allow for users to change the debug mode when calling the JVM |
Constructor Summary | |
---|---|
HTLogger()
|
Method Summary | |
---|---|
static boolean |
debugMode()
|
static void |
log(String message)
Logs a message to the PrintStream , if debug mode is true. |
static void |
log(Throwable t)
Logs the full stack trace of a throwable. |
static void |
setDebugMode(boolean newDebugMode)
Allows it for programmatic change of the debug mode. |
static void |
setOutput(PrintStream newPs)
Replaces the PrintStream used by this class to log messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HYPHEN_TYPE_DEBUG_MODE
Constructor Detail |
---|
public HTLogger()
Method Detail |
---|
public static void log(String message)
PrintStream
, if debug mode is true.
message
- The message to logpublic static void log(Throwable t)
message
- The throwable to logpublic static void setOutput(PrintStream newPs)
PrintStream
used by this class to log messages. Does nothing if the
provided argument is null. If you want this class to stop writing log outputs, you should
set the debug mode to false using the method setDebugMode(boolean)
.
newPs
- The new print stream to be usedpublic static void setDebugMode(boolean newDebugMode)
newDebugMode
- The new debug modepublic static boolean debugMode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |