setDebugMode(boolean)
method. Classes that want to print information under debugging circumstances should call the debug(String)
method.Debug printing is turned off by default.
Static Public Member Functions | |
static final void | setDebugMode (boolean onoff) |
Sets the debug printing mode for this application. | |
static final boolean | getDebugMode () |
Gets the debug printing mode for this application. | |
static final void | setPrintStream (PrintStream outStream) |
Sets the output stream for printing the debug info. | |
static final void | debug (String x) |
Prints the specified java.lang.String object if debug mode is enabled. | |
static final void | debug (String lbl, byte[] bytes) |
Prints the specified array of bytes with a given label if debug mode is enabled. | |
static final void | debug (String lbl, byte[] bytes, int offset, int length) |
Prints the specified array of bytes with a given label if debug mode is enabled. | |
static final void | debug (String lbl, Throwable t) |
Prints the specified exception with a given label if debug mode is enabled. | |
static final void | stackTrace () |
Prints out an exception stack trace for debugging purposes. | |
Static Package Functions | |
[static initializer] | |
Static constructor. |
[static initializer] | ( | ) | [static, package] |
Static constructor.
Checks system properties to see if debugging is enabled by default. Also, will redirect debug output to a log file if specified.
static final void setDebugMode | ( | boolean | onoff | ) | [static] |
Sets the debug printing mode for this application.
<code>true</code> | to see debug messages, false to suppress them |
static final boolean getDebugMode | ( | ) | [static] |
Gets the debug printing mode for this application.
true
indicates debug messages are on, false
supresses them. static final void setPrintStream | ( | PrintStream | outStream | ) | [static] |
Sets the output stream for printing the debug info.
out | the output stream for printing the debug info. |
static final void debug | ( | String | x | ) | [static] |
Prints the specified java.lang.String
object if debug mode is enabled.
This method calls PrintStream.println(String)
, and pre-pends the String
">> " to the message, so taht if a program were to call (when debug mode was enabled):
the resulting output would look like:
com.dalsemi.onewire.debug.Debug.debug("Some notification...");
>> Some notification...
x | the message to print out if in debug mode |
static final void debug | ( | String | lbl, | |
byte[] | bytes | |||
) | [static] |
Prints the specified array of bytes with a given label if debug mode is enabled.
This method calls PrintStream.println(String)
, and pre-pends the String
">> " to the message, so taht if a program were to call (when debug mode was enabled):
the resulting output would look like:
com.dalsemi.onewire.debug.Debug.debug("Some notification...", myBytes);
>> my label
>> FF F1 F2 F3 F4 F5 F6 FF
lbl | the message to print out above the array | |
bytes | the byte array to print out |
static final void debug | ( | String | lbl, | |
byte[] | bytes, | |||
int | offset, | |||
int | length | |||
) | [static] |
Prints the specified array of bytes with a given label if debug mode is enabled.
This method calls PrintStream.println(String)
, and pre-pends the String
">> " to the message, so taht if a program were to call (when debug mode was enabled):
the resulting output would look like:
com.dalsemi.onewire.debug.Debug.debug("Some notification...", myBytes, 0, 8);
>> my label
>> FF F1 F2 F3 F4 F5 F6 FF
lbl | the message to print out above the array | |
bytes | the byte array to print out | |
offset | the offset to start printing from the array | |
length | the number of bytes to print from the array |
static final void debug | ( | String | lbl, | |
Throwable | t | |||
) | [static] |
Prints the specified exception with a given label if debug mode is enabled.
This method calls PrintStream.println(String)
, and pre-pends the String
">> " to the message, so taht if a program were to call (when debug mode was enabled):
the resulting output would look like:
com.dalsemi.onewire.debug.Debug.debug("Some notification...", exception);
>> my label
>> OneWireIOException: Device Not Present
lbl | the message to print out above the array | |
bytes | the byte array to print out | |
offset | the offset to start printing from the array | |
length | the number of bytes to print from the array |
static final void stackTrace | ( | ) | [static] |
Prints out an exception stack trace for debugging purposes.
This is useful to figure out which functions are calling a particular function at runtime.