(...)".
Every method should have its own assertions to test the state
of its arguments on entry into the method.
Set DEBUG_MODE to false to turn off all assertion testing.
(Be absolutely sure that your code is working perfectly first!)
Do this with the code: Debug.setDebugger(false);
Test for with: Debug.isDebugging();
Set FATAL_RESPONSE to false to turn off program death on failure
of any assertion.
Do this with the code: Debug.setFatalResponse(false);
Test for with: Debug.isFatalResponse();
Set TRACE_MODE to false to turn off tracing of non-failed
assertions.
Do this with the code: Debug.setTracer(false);
Test for with: Debug.isTracing();
Set MESSAGE_MORE to false to turn off message assertions.
Do this with the code: Debug.setMessenger(false);
Test for with: Debug.isMessaging();
Set WATCH_MODE to false to turn off watching of specific
classes, methods, or packages.
Do this with the code: Debug.setWatcher(false);
Test for with: Debug.isWatching();
Set IGNORE_MORE to false to turn off ignoring of specific
classes, methods, or packages.
Do this with the code: Debug.setIgnorer(false);
Test for with: Debug.isIgnoring();
Use the addTarget(String) and removeTarget(String) methods
to target specific methods, classes, or packages.
Example: Debug.addTarget("org.datamanager.kernel.");
This will make the debugger only report assertions from
the "org.datamanager.kernel." package.
Use the addIgnore(String) and removeIgnore(String) methods
to make the debugger ignore specific methods, classes, or
packages.
Example: Debug.addIgnore("org.datamanager.kernel.");
This will make the debugger ignore all assertions from
the "org.datamanager.kernel." package.
Note about watching and ignoring:
Currently the strings that are used for watching and ignoring
are tested with the String.indexOf() method. This means that
if you pass the String, "a", to one of the add...() methods
you will either ignore or watch for the String "a" in a
method signatures. Example of method signature:
"org.datamanager.kernel.Entity.getValue(Entity.java:##)" is
the signature of the method Entity.getValue(). Notice that
this method signature constains the String "a" and would
thus be matched by a watch or ignore string. Try to be as
specific as possible when adding watch or ignore strings,
because your string might match something unexpected.
**Also, ignoring a string will override watching for it.**
Ie: If you watch for "hello" and ignore "hello" with
IGNORE_MODE on, then the string "hello" will be ignored.
- Author:
- Gregory Rawlins.
, Matthew Farrellee
Constructor Summary |
Debug()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Debug
public Debug()
writeLogMessage
public static final void writeLogMessage(Object message)
- If setMessenger() and setDebugger() have both been set to true, writes
the value of message.toString() onto stdout.
watched
public static boolean watched(String caller)
addIgnore
public static void addIgnore(String target)
addTarget
public static void addTarget(String target)
removeIgnore
public static void removeIgnore(String target)
removeTarget
public static void removeTarget(String target)
setWatcher
public static void setWatcher(boolean state)
setDebugger
public static void setDebugger(boolean state)
setTracer
public static void setTracer(boolean state)
setFatalResponse
public static void setFatalResponse(boolean state)
setMessenger
public static void setMessenger(boolean state)
isWatching
public static boolean isWatching()
isDebugging
public static boolean isDebugging()
isTracing
public static boolean isTracing()
isFatalResponse
public static boolean isFatalResponse()
isMessaging
public static boolean isMessaging()
See the Helium Website