Class powersoft.jcm.util.Debug
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class powersoft.jcm.util.Debug

java.lang.Object
   |
   +----powersoft.jcm.util.Debug

public class Debug
extends Object

Variable Index

 o LOG_ALL
 o LOG_FORCEALL
 o LOG_GENERAL
 o LOG_GROUPS
 o LOG_NONE
constants used in the LogMode property LOG_NONE - no logs LOG_GENERAL - enables general logs only LOG_GROUPS - enables group logs only LOG_ALL - enables general and group logs LOG_FORCEALL - enables general and group logs, plus the group logs that have not been enabled by setGroupLog

Constructor Index

 o Debug()

Method Index

 o abort()
Throws a run-time exception.
 o abort(String)
 o abort(Throwable)
 o assert(boolean)
If CompileTarget.getDebug() is true and if the condition cond is false, a message box comes up and you can choose to: exit the program, or ignore the assertion fault and continue.
 o assert(boolean, String)
 o checkArgument(boolean)
Throws an IllegalArgumentException if a condition is false.
 o checkArgument(boolean, String)
 o checkCreated(boolean)
Throws a NotCreatedException if a condition is false.
 o checkCreated(boolean, String)
 o checkState(boolean)
Throws an InvalidStateException if a condition is false.
 o checkState(boolean, String)
 o getDetailedLog()
Gets the detailed log property.
 o getGroupLog(String)
Gets the enabled state of a log group.
 o getLogMode()
Gets the log mode.
 o getLogStream()
gets the log stream to which logs are made
 o log(byte[])
 o log(String)
Makes a general log to the log stream.
 o log(String, byte[])
 o log(String, String)
Makes a group log to the log stream.
 o log(String, Throwable)
 o log(Throwable)
 o logThreadInfo(ThreadGroup)
Logs information describing the threads in the given group.
 o printStackTrace()
prints the trace of the current call stack to the log stream
 o printStackTrace(PrintStream)
prints the trace of the current call stack
 o setDetailedLog(boolean)
Sets the detailed log property.
 o setGroupLog(String, boolean)
Enables or disables a log group.
 o setLogMode(byte)
Sets the log mode
 o setLogStream(PrintStream)
sets the log stream to which logs are made
 o verify(boolean)
If CompileTarget.getDebug() is true and if the condition cond is false, a message box comes up and you can choose to: exit the program, or throw a runtime exception, or ignore the assertion fault and continue.
 o verify(boolean, String)

Variables

 o LOG_NONE
  public final static byte LOG_NONE
constants used in the LogMode property LOG_NONE - no logs LOG_GENERAL - enables general logs only LOG_GROUPS - enables group logs only LOG_ALL - enables general and group logs LOG_FORCEALL - enables general and group logs, plus the group logs that have not been enabled by setGroupLog @see #setLogMode, #log, #setGroupLog
 o LOG_GENERAL
  public final static byte LOG_GENERAL
 o LOG_GROUPS
  public final static byte LOG_GROUPS
 o LOG_ALL
  public final static byte LOG_ALL
 o LOG_FORCEALL
  public final static byte LOG_FORCEALL

Constructors

 o Debug
  public Debug()

Methods

 o assert
  public static void assert(boolean cond)
If CompileTarget.getDebug() is true and if the condition cond is false, a message box comes up and you can choose to: exit the program, or ignore the assertion fault and continue.

If CompileTarget.getDebug() is false, nothing happens. @parm cond condition to test against @parm msg (optional) detailed message if condition fails

 o assert
  public static void assert(boolean cond,
                            String msg)
 o verify
  public static void verify(boolean cond)
If CompileTarget.getDebug() is true and if the condition cond is false, a message box comes up and you can choose to: exit the program, or throw a runtime exception, or ignore the assertion fault and continue.

If CompileTarget.getDebug() is false and if the condition cond is false, a runtime exception is thrown. @parm cond condition to test against @parm msg (optional) detailed message if condition fails @exception RuntimeException if cond is false

 o verify
  public static void verify(boolean cond,
                            String msg)
 o checkArgument
  public static void checkArgument(boolean cond)
Throws an IllegalArgumentException if a condition is false. @parm cond condition to test against @parm msg (optional) detailed message if condition fails @throws IllegalArugmentException if condition fails
 o checkArgument
  public static void checkArgument(boolean cond,
                                   String msg)
 o checkState
  public static void checkState(boolean cond)
Throws an InvalidStateException if a condition is false. @parm cond condition to test against @parm msg (optional) detailed message if condition fails @throws InvalidStateException if condition fails
 o checkState
  public static void checkState(boolean cond,
                                String msg)
 o checkCreated
  public static void checkCreated(boolean cond)
Throws a NotCreatedException if a condition is false. @parm cond condition to test against @parm msg (optional) detailed message if condition fails @throws NotCreatedException if condition fails
 o checkCreated
  public static void checkCreated(boolean cond,
                                  String msg)
 o abort
  public static void abort()
Throws a run-time exception. @throws RuntimeExceptionBase
 o abort
  public static void abort(Throwable err)
 o abort
  public static void abort(String msg)
 o printStackTrace
  public static void printStackTrace()
prints the trace of the current call stack to the log stream @parm stream (optional) - stream to output
 o printStackTrace
  public static void printStackTrace(PrintStream stream)
prints the trace of the current call stack @parm stream - stream to output to
 o log
  public static void log(String message)
Makes a general log to the log stream. @parm message - message to be displayed @parm err - error to be displayed @notes General logs can be enabled by setting the property LogMode to LOG_GENERAL, LOG_ALL or LOG_FORCEALL. General logs are disabled if the LogMode property is set to LOG_NONE or LOG_GROUPS. @see #setLogMode
 o log
  public static void log(byte message[])
 o log
  public static void log(Throwable err)
 o log
  public static void log(String group,
                         String message)
Makes a group log to the log stream. @parm group - name of the group @parm message - message to be displayed @parm err - error to be displayed @notes Each group log can be enabled or disabled using #setGroupLog. You can enable all group logs by setting the property LogMode to LOG_FORCEALL, or disable all group logs by setting the property LogMode to LOG_NONE or LOG_GENERAL. @see #setGroupLog, #setLogMode
 o log
  public static void log(String group,
                         byte message[])
 o log
  public static void log(String group,
                         Throwable err)
 o logThreadInfo
  public static void logThreadInfo(ThreadGroup group)
Logs information describing the threads in the given group. @param group The thread group to log. If null, the group of the current thread is used.
 o getDetailedLog
  public static boolean getDetailedLog()
Gets the detailed log property. @see setDetailedLog
 o setDetailedLog
  public static void setDetailedLog(boolean detailedLog)
Sets the detailed log property. @notes If the detailed log property is on, the stack trace is also printed on every log.
 o getGroupLog
  public static boolean getGroupLog(String group)
Gets the enabled state of a log group.
 o setGroupLog
  public static void setGroupLog(String group,
                                 boolean log)
Enables or disables a log group. @see #log
 o getLogMode
  public static byte getLogMode()
Gets the log mode. The default is LOG_ALL. @returns: LOG_NONE - no logs LOG_GENERAL - general logs only LOG_GROUPS - enabled group logs only LOG_ALL - general and enabled group logs LOG_FORCEALL - all logs (including disabled logs)
 o setLogMode
  public static void setLogMode(byte log)
Sets the log mode @parm log: LOG_NONE - no logs LOG_GENERAL - general logs only LOG_GROUPS - enabled group logs only LOG_ALL - general and enabled group logs LOG_FORCEALL - all logs (including disabled logs)
 o getLogStream
  public static PrintStream getLogStream()
gets the log stream to which logs are made @returns the log stream @see #setLogStream, #log
 o setLogStream
  public static void setLogStream(PrintStream stream)
sets the log stream to which logs are made @parm stream log stream @exception IllegalArugmentException if stream is null @see #getLogStream, #log

All Packages  Class Hierarchy  This Package  Previous  Next  Index