org.freeshell.zs.common
Class Debug

java.lang.Object
  extended by org.freeshell.zs.common.Debug

public class Debug
extends java.lang.Object

Perform debugging-related operations.


Constructor Summary
Debug()
           
 
Method Summary
static java.lang.String getStackTraceString(java.lang.Exception ex)
          Get a string representation of the stack trace for the specified exception.
static java.lang.String getSystemInformationString()
          Get a string representation of the system information (OS, JRE, JVM).
static java.lang.String getSystemProperty(java.lang.String key)
          Get the specified system property, without throwing any exceptions.
static void p(java.lang.Object o)
          Print the string representation of the specified object to the standard error output stream.
static void pt(java.lang.Object o)
          Print the string representation of the specified object to the standard error output stream, with a timestamp.
static void setSystemProperty(java.lang.String key, java.lang.String value)
          Set the specified system property, without throwing any exceptions.
static void sleep(long millis)
          Sleep for the specified number of milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Debug

public Debug()
Method Detail

p

public static void p(java.lang.Object o)
Print the string representation of the specified object to the standard error output stream.

Parameters:
o - object to the printed

pt

public static void pt(java.lang.Object o)
Print the string representation of the specified object to the standard error output stream, with a timestamp.

Parameters:
o - object to the printed

getStackTraceString

public static java.lang.String getStackTraceString(java.lang.Exception ex)
Get a string representation of the stack trace for the specified exception.

Parameters:
ex - exception
Returns:
string representation of the stack trace

getSystemInformationString

public static java.lang.String getSystemInformationString()
Get a string representation of the system information (OS, JRE, JVM).

Returns:
string representation of the system information

getSystemProperty

public static java.lang.String getSystemProperty(java.lang.String key)
Get the specified system property, without throwing any exceptions.

Parameters:
key - key of the system property to be obtained
Returns:
String representation of the specified system property

setSystemProperty

public static void setSystemProperty(java.lang.String key,
                                     java.lang.String value)
Set the specified system property, without throwing any exceptions.

Parameters:
key - key of the system property to be set
value - value of the system property

sleep

public static void sleep(long millis)
Sleep for the specified number of milliseconds. This method uses the Thread.sleep() method, but will ignore the InterruptedException exception if thrown.

Parameters:
millis - number of milliseconds to sleep